Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of MPU9250_SPI by
Diff: MPU9250.cpp
- Revision:
- 3:f4fa24cc247d
- Parent:
- 2:f274ea3bced9
- Child:
- 4:79185409730f
--- a/MPU9250.cpp Sat Jun 21 12:39:55 2014 +0000 +++ b/MPU9250.cpp Wed Jun 25 15:41:05 2014 +0000 @@ -244,7 +244,7 @@ usage: call this function to read temperature data. returns the value in °C -----------------------------------------------------------------------------------------------*/ -float mpu9250_spi::read_temp(){ +void mpu9250_spi::read_temp(){ uint8_t response[2]; int16_t bit_data; float data; @@ -252,9 +252,8 @@ bit_data=((int16_t)response[0]<<8)|response[1]; data=(float)bit_data; - data=(data/340)+36.53; + Temperature=(data/340)+36.53; deselect(); - return data; } /*-----------------------------------------------------------------------------------------------