First Commit
Dependencies: mbed Crypto_light mbed-rtos
Spin it 2 win it
Diff: main.cpp
- Revision:
- 25:bf5fff055aef
- Parent:
- 24:0a0e22d4d8d3
- Child:
- 26:1a7a154e375b
- Child:
- 27:d50f1914f23a
diff -r 0a0e22d4d8d3 -r bf5fff055aef main.cpp --- 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_)) {