hnct-robocon / BNO055

Files at this revision

API Documentation at this revision

Comitter:
Robo_DOGUMA
Date:
Sat Jun 22 00:15:47 2019 +0000
Parent:
7:e9b258eaa3a4
Commit message:
BNO055

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 Jan 19 06:43:46 2019 +0000
+++ b/BNO055.cpp	Sat Jun 22 00:15:47 2019 +0000
@@ -10,7 +10,17 @@
     angle_scale = 1.0f/16.0f;
     temp_scale = 1;
     }
-    
+
+BNO055::BNO055(I2C& i2c) : _i2c(i2c)
+{
+    _i2c.frequency(400000);
+    address = BNOAddress;
+    accel_scale = 0.001f;
+    rate_scale = 1.0f/16.0f;
+    angle_scale = 1.0f/16.0f;
+    temp_scale = 1;
+}
+
 void BNO055::reset(){
 //Perform a power-on-reset
     readchar(BNO055_SYS_TRIGGER_ADDR);
--- a/BNO055.h	Sat Jan 19 06:43:46 2019 +0000
+++ b/BNO055.h	Sat Jun 22 00:15:47 2019 +0000
@@ -180,7 +180,7 @@
 
 /** Create BNO055 instance **/
     BNO055(PinName SDA, PinName SCL); 
-    
+    BNO055(I2C& _i2c);
 /** Perform a power-on reset of the BNO055 **/
     void reset();
 /** Check that the BNO055 is connected and download the software details