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: mbed QEI FastAnalogIn mbed-rtos FastPWM
Revision 6:4e710cef655e, committed 2019-04-01
- Comitter:
- dofydoink
- Date:
- Mon Apr 01 14:15:31 2019 +0000
- Parent:
- 4:3bab17dfae4e
- Commit message:
- Fixed quantization error in sensor position message to ML. Was caused by incorrectly casting to an int (use brackets to force order of operations!).
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r 3bab17dfae4e -r 4e710cef655e main.cpp --- a/main.cpp Wed Jan 30 13:05:42 2019 +0000 +++ b/main.cpp Mon Apr 01 14:15:31 2019 +0000 @@ -481,7 +481,7 @@ //printf("%f\r\n",dblPosD[intDemPosFilOrder]); - intFeedBack_pos = (int) dblPos[intPosFilOrder]/MAX_ACTUATOR_LENGTH*511; + intFeedBack_pos = (int) ((dblPos[intPosFilOrder]/MAX_ACTUATOR_LENGTH)*511); if(intFeedBack_pos>511) {