Dependencies: mbed Servo mbed-rtos Motor
Diff: main.cpp
- Revision:
- 7:aa95fa560952
- Parent:
- 6:0597a4ac4696
- Child:
- 8:c59f12a4960f
--- a/main.cpp Mon Apr 27 20:42:28 2020 +0000 +++ b/main.cpp Mon Apr 27 20:43:58 2020 +0000 @@ -37,12 +37,12 @@ float bottomServoPos = 0.0; while(1){ - if(xpadState == 1) //pan right + if(xpadState == -1) //pan right { bottomServoPos = bottomServoPos + 0.05; if(bottomServoPos > 1.0) bottomServoPos = 1.0; } - else if(xpadState == -1) //pan left + else if(xpadState == 1) //pan left { bottomServoPos = bottomServoPos - 0.05; if(bottomServoPos < 0.0) bottomServoPos = 0.0;