code of robot bike
Dependencies: SDFileSystem mbed
Fork of Robot_Bicycle by
Diff: SPI_9dSensor.cpp
- Revision:
- 11:45a641da473d
- Parent:
- 10:3b952ea7fad4
--- a/SPI_9dSensor.cpp Mon Jul 18 12:12:50 2016 +0000 +++ b/SPI_9dSensor.cpp Wed Jan 18 15:48:47 2017 +0000 @@ -256,9 +256,9 @@ void get_9axis_scale(void) { - Gyro_scale[0] = ((float)Gyro_axis_data[0]-Gyro_axis_zero[0])*Gyro_gainx; - Gyro_scale[1] = ((float)Gyro_axis_data[1]-Gyro_axis_zero[1])*Gyro_gainy; - Gyro_scale[2] = ((float)Gyro_axis_data[2]-Gyro_axis_zero[2])*Gyro_gainz; + Gyro_scale[0] = ((float)(Gyro_axis_data[0]-Gyro_axis_zero[0]))*Gyro_gainx; + Gyro_scale[1] = ((float)(Gyro_axis_data[1]-Gyro_axis_zero[1]))*Gyro_gainy; + Gyro_scale[2] = ((float)(Gyro_axis_data[2]-Gyro_axis_zero[2]))*Gyro_gainz; Acce_scale[0] = ((float)(Acce_axis_data[0]-Acce_axis_zero[0]))*Acce_gainx; Acce_scale[1] = ((float)(Acce_axis_data[1]-Acce_axis_zero[1]))*Acce_gainy; Acce_scale[2] = ((float)(Acce_axis_data[2]-Acce_axis_zero[2]))*Acce_gainz;