Mark Peter Vargha / BNO055

Dependents:   Project Campus_Safety_Bot

Fork of BNO055 by Dave Turner

Files at this revision

API Documentation at this revision

Comitter:
StressedDave
Date:
Sun May 31 07:22:40 2015 +0000
Parent:
2:695c6e5d239a
Child:
4:481ecdf3baf8
Commit message:
Corrected error in acquisition of euler angles

Changed in this revision

BNO055.cpp Show annotated file Show diff for this revision Revisions of this file
BNO055.h Show annotated file Show diff for this revision Revisions of this file
--- a/BNO055.cpp	Sat May 30 19:08:59 2015 +0000
+++ b/BNO055.cpp	Sun May 31 07:22:40 2015 +0000
@@ -198,12 +198,12 @@
     tx[0] = BNO055_EULER_H_LSB_ADDR;
     _i2c.write(address,tx,1,true);  
     _i2c.read(address+1,rawdata,6,0); 
-    angles.rawyaw = (rawdata[1] << 8 | rawdata[0]);
-    angles.rawroll = (rawdata[3] << 8 | rawdata[2]);
-    angles.rawpitch = (rawdata[5] << 8 | rawdata[4]);
-    angles.yaw = float(angles.rawyaw)*angle_scale;
-    angles.roll = float(angles.rawroll)*angle_scale;
-    angles.pitch = float(angles.rawpitch)*angle_scale;
+    euler.rawyaw = (rawdata[1] << 8 | rawdata[0]);
+    euler.rawroll = (rawdata[3] << 8 | rawdata[2]);
+    euler.rawpitch = (rawdata[5] << 8 | rawdata[4]);
+    euler.yaw = float(euler.rawyaw)*angle_scale;
+    euler.roll = float(euler.rawroll)*angle_scale;
+    euler.pitch = float(euler.rawpitch)*angle_scale;
 }
 
 
--- a/BNO055.h	Sat May 30 19:08:59 2015 +0000
+++ b/BNO055.h	Sun May 31 07:22:40 2015 +0000
@@ -246,7 +246,7 @@
     char calib;
 /** Contents of the 22 registers containing offset and radius values used as calibration by the sensor **/
     char calibration[22];
-/** Structure containing sensor numbers, software version and chip UID
+/** Structure containing sensor numbers, software version and chip UID **/
     chip ID;
 /** Current temperature **/
     int temperature;