Implement new controller

Dependencies:   mbed-rtos mbed QEI BNO055 MPU6050_DMP_Nucleo-I2Cdev virgo3_imuHandler_Orion_PCB MAX17048 Servo

Fork of Orion_newPCB_test by Team Virgo v3

Revision:
6:690db8b5030b
Parent:
5:099cb2e76c7d
--- a/01_DriveTrain/odometer.h	Mon Jan 25 07:28:40 2016 +0000
+++ b/01_DriveTrain/odometer.h	Thu Feb 04 02:11:36 2016 +0000
@@ -13,8 +13,9 @@
 public:
     odometer();
     void update();
-    void getRevolutions(float *revolutions[2]);
-    void getRPM(float *rpm[2]);
+    void init();
+    //void getRevolutions(float *revolutions[2]);
+    //void getRPM(float *rpm[2]);
     
     float revolutions[2];
     float rpm[2];
@@ -26,15 +27,15 @@
     Timer enc_timer;
     float timer_s;
     
-    unsigned int movWindow_len;
-    unsigned int movWindow_index;
+    uint16_t movWindow_len;
+    uint16_t movWindow_index;
     float encRes;
     
     static const unsigned int movWindow_lenMax = 64; //to prevent excessive RAM usage at program runtime
     
     int32_t pulse_counter[2][2]; // [0:left / 1:right], [0:previous / 1:current]
-    float rpmWindow_left[]; // [movWindow_index: instantaneous velocity in rpm]
-    float rpmWindow_right[]; // [movWindow_index: instantaneous velocity in rpm]
+    float rpmWindow_left[movWindow_lenMax]; // [movWindow_index: instantaneous velocity in rpm]
+    float rpmWindow_right[movWindow_lenMax]; // [movWindow_index: instantaneous velocity in rpm]
     
     float filtered_reading[2][2]; // [0:left / 1:right], [0:revolutions / 1:velocity in rpm]
 };