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 Crypto_light mbed-rtos
Revision 25:bf5fff055aef, committed 2018-03-20
- Comitter:
- andrebharath
- Date:
- Tue Mar 20 18:59:22 2018 +0000
- Parent:
- 24:0a0e22d4d8d3
- Child:
- 26:1a7a154e375b
- Child:
- 27:d50f1914f23a
- Commit message:
- Printing torque. Changed torque from uint32_t to int32_t
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Tue Mar 20 18:38:08 2018 +0000 +++ b/main.cpp Tue Mar 20 18:59:22 2018 +0000 @@ -50,7 +50,7 @@ volatile int8_t orState = 0; //Set initial torque of 1000 -volatile uint32_t torque = 1000; +volatile int32_t torque = 1000; enum MSG {MSG_RESET, MSG_HASHCOUNT, MSG_NONCE_OK, @@ -166,9 +166,9 @@ oldPos = curPos; count = (count+1)%10; if (!count) { - putMessage(MSG_CUR_SPD, curSpeed); + putMessage(MSG_CUR_SPD, torque); } - torque = (uint32_t)(KP*(targetSpeed-abs(curSpeed))); + torque = (int32_t)(KP*(targetSpeed-abs(curSpeed))); } } @@ -177,7 +177,7 @@ void setNewCmd(char s[CHAR_ARR_SIZE]) { uint64_t newKey_; - uint32_t torque_; + int32_t torque_; float targetSpeed_, rotations_pending_; //R if (sscanf(s, "R%f", &rotations_pending_)) {