Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: biquadFilter FastPWM MODSERIAL QEI mbed
Diff: main.cpp
- 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 =============================