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: FastPWM MODSERIAL mbed QEI
Diff: main.cpp
- Revision:
- 2:306998d368fc
- Parent:
- 1:08d285e33eea
- Child:
- 3:5cb5f0f22c5a
--- a/main.cpp Mon Jun 11 07:47:13 2018 +0000 +++ b/main.cpp Mon Jun 11 07:54:25 2018 +0000 @@ -264,7 +264,10 @@ //State Guard if ((abs(motorVel) < 0.001f) && (t.read()-stateTime > 1.0f)) { currentState = stateHoming; - encoderPos = MAX_ENCODER_POS_LEFT; //When calibrated, set encoder pos to the known value + enc.reset(); // set pulses to zero + + // NEED TO UPDATE CALIBRATION HERE. + //encoderPos = -MAX_ENCODER_POS_LEFT; //When calibrated, set encoder pos to the known value stateTime = t.read(); refPos = (float)MAX_ENCODER_POS_LEFT / ENCODER_CPR * TWO_PI; //Start at the left calibration point }