forked
Fork of MPU9250_SPI by
Diff: MPU9250.cpp
- Revision:
- 12:1056a7f87bd0
- Parent:
- 11:084e8ba240c1
--- a/MPU9250.cpp Tue Jul 01 13:59:45 2014 +0000 +++ b/MPU9250.cpp Wed Nov 29 06:29:21 2017 +0000 @@ -256,7 +256,7 @@ bit_data=((int16_t)response[0]<<8)|response[1]; data=(float)bit_data; - Temperature=(data/340)+36.53; + Temperature=((double)data/340)+36.53; deselect(); } @@ -361,7 +361,7 @@ //Get temperature bit_data=((int16_t)response[i*2]<<8)|response[i*2+1]; data=(float)bit_data; - Temperature=((data-21)/333.87)+21; + Temperature=(((double)data-21)/333.87)+21; //Get gyroscop value for(i=4; i<7; i++) { bit_data=((int16_t)response[i*2]<<8)|response[i*2+1];