College Project
Dependents: MPU9250_SPI_Test_1201
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; } /*-----------------------------------------------------------------------------------------------