With pid left, right, and foward
Dependents: wheelchaircontrol wheelchaircontrolRosCom wheelchaircontrol wheelchaircontrol2 ... more
Fork of chair_BNO055 by
Diff: chair_BNO055.h
- Revision:
- 1:3258d62af038
- Parent:
- 0:ad7a811c859f
- Child:
- 3:531a74cecb89
diff -r ad7a811c859f -r 3258d62af038 chair_BNO055.h --- a/chair_BNO055.h Fri Jul 20 17:54:09 2018 +0000 +++ b/chair_BNO055.h Wed Aug 01 22:39:10 2018 +0000 @@ -1,6 +1,7 @@ #ifndef CHAIR_BNO055_H #define CHAIR_BNO055_H +#include "filter.h" #include "mbed.h" #include "math.h" #include "BNO055.h" @@ -8,13 +9,14 @@ #define PI 3.141593 #define SDA D14 #define SCL D15 - +#define SAMPLEFREQ 50 +#define CAL_TIME 3 class chair_BNO055 { public: - chair_BNO055(); - chair_BNO055(PinName sda_pin, PinName scl_pin); + chair_BNO055(Serial* out, Timer* time); + chair_BNO055(PinName sda_pin, PinName scl_pin, Serial* out, Timer* time); void setup(); double accel_x(); double accel_y(); @@ -26,9 +28,14 @@ double yaw(); double pitch(); double roll(); - + BNO055* imu; private: - BNO055* imu; + //BNO055* imu; + Serial* usb; + Timer* t; + bool start; + void setStart(); + void calibrate_yaw(); }; #endif