File tree Expand file tree Collapse file tree 1 file changed +65
-1
lines changed Expand file tree Collapse file tree 1 file changed +65
-1
lines changed Original file line number Diff line number Diff line change @@ -337,4 +337,68 @@ Serial.println("X\tY\tZ");
337337* [ readGyroscope()] ( #readgyroscope )
338338* [ accelerationAvailable()] ( #accelerationavailable )
339339* [ gyroscopeAvailable()] ( #gyroscopeavailable )
340- * [ accelerationSampleRate()] ( #accelerationsamplerate )
340+ * [ accelerationSampleRate()] ( #accelerationsamplerate )
341+
342+ ### ` readTemperature() `
343+
344+ Reads the temperature from the sensor (Celsius).
345+
346+ #### Syntax
347+
348+ ```
349+ IMU.readTemperature()
350+ ```
351+
352+ #### Parameters
353+
354+ None.
355+
356+ #### Returns
357+
358+ The temperature in Celsius.
359+
360+ #### Example
361+
362+ ```
363+ if (IMU.temperatureAvailable())
364+ {
365+ int temperature_deg = 0;
366+ IMU.readTemperature(temperature_deg);
367+
368+ Serial.print("LSM6DSOX Temperature = ");
369+ Serial.print(temperature_deg);
370+ Serial.println(" °C");
371+ }
372+ ```
373+
374+ ### ` temperatureAvailable() `
375+
376+ Checks if temperature data is available.
377+
378+ #### Syntax
379+
380+ ```
381+ IMU.temperatureAvailable()
382+ ```
383+
384+ #### Parameters
385+
386+ None.
387+
388+ #### Returns
389+
390+ 1 on success, 0 on failure.
391+
392+ #### Example
393+
394+ ```
395+ if (IMU.temperatureAvailable())
396+ {
397+ int temperature_deg = 0;
398+ IMU.readTemperature(temperature_deg);
399+
400+ Serial.print("LSM6DSOX Temperature = ");
401+ Serial.print(temperature_deg);
402+ Serial.println(" °C");
403+ }
404+ ```
You can’t perform that action at this time.
0 commit comments