pid foward back and reverse

Dependencies:   PID QEI chair_BNO055 ros_lib_kinetic

Dependents:  

Fork of wheelchaircontrol by ryan lin

Revision:
4:29a27953fe70
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/imu.cpp	Tue Jul 17 02:29:26 2018 +0000
@@ -0,0 +1,23 @@
+#include "imu.h"
+
+Imu::Imu(){
+  imu = new BNO055(SDA, SCL);
+}
+
+Imu::Imu(PinName sda_pin, PinName scl_pin){
+  imu = new BNO055(sda_pin, scl_pin);
+}
+void Imu::setup(){
+  imu.reset();
+  pc.printf("Bosch Sensortec BNO055 test program on \r\n");
+  while (imu.check() == 0) {
+    pc.printf("Bosch BNO055 is NOT available!!\r\n");
+    wait(.5);
+  }
+  pc.printf("Bosch Sensortec BNO055 available \r\n");
+  imu.set_accel_units(MPERSPERS);
+  imu.setmode(OPERATION_MODE_AMG);
+  imu.get_calib();
+  imu.write_calibration_data();
+  imu.set_angle_units(DEGREES);
+}
\ No newline at end of file