Tommie Verouden / Mbed 2 deprecated StateMachine

Dependencies:   biquadFilter FastPWM MODSERIAL QEI mbed

Revision:
26:247be0bea9b1
Parent:
25:ac139331fe51
Child:
33:44ba3c159f54
--- a/main.cpp	Thu Nov 01 13:55:12 2018 +0000
+++ b/main.cpp	Thu Nov 01 14:06:35 2018 +0000
@@ -51,7 +51,7 @@
 Ticker      motorF;
 
 // Define & initialise state machine
-const float dt = 0.02f
+const float dt = 0.002f;
 enum states {   calibratingMotors, calibratingEMG,
                 homing, reading, operating, failing, demoing
             };
@@ -151,8 +151,24 @@
 Ticker simulateval;                                             //Timer that prints the values for x,y, and angles
 
 // ---------------------- Parameters for the motors ---------------------------
+const float     countsRad = 4200.0f;
+int     countsL;
+int     countsR;
+int     countsF;
+int     countsCalibratedL;
+int     countsCalibratedR;
+int     countsCalibratedF;
+float   angleCurrentL;
+float   angleCurrentR;
+float   angleCurrentF;
+float   errorL;
+float   errorR;
+float   errorF;
+float   errorCalibratedL;
+float   errorCalibratedR;
+float   errorCalibratedF;
 
-
+int     countsCalibration = 4200/4;
 
 // ≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡ FUNCTIONS ≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡
 // ============================ GENERAL FUNCTIONS =============================