self-balancing-robot
Dependencies: mbed mbed-rtos Motor
Diff: main.cpp
- Revision:
- 32:c3676d4df853
- Parent:
- 31:aa1ea0973c96
- Child:
- 33:391f89df9c60
- Child:
- 34:d6c0cf60cecd
--- a/main.cpp Thu Apr 23 20:21:45 2020 +0000 +++ b/main.cpp Thu Apr 23 20:35:32 2020 +0000 @@ -130,8 +130,8 @@ void set_wheel_speed(float speed) { if(speed > 1) speed = 1; if (speed < -1) speed = -1; - leftWheel.speed(speed); - rightWheel.speed(speed); + leftWheel.speed(speed*(-1)); + rightWheel.speed(speed*(-1)); }