Dependencies: mbed Servo mbed-rtos Motor
Diff: main.cpp
- Revision:
- 3:80579b8865db
- Parent:
- 1:3f064275f04d
- Child:
- 5:8500e9326652
--- a/main.cpp Sat Apr 25 19:28:22 2020 +0000 +++ b/main.cpp Mon Apr 27 01:30:30 2020 +0000 @@ -22,6 +22,7 @@ //rotate the pan/tilt servos void RotateServos() { + while(1){ if(xpadState == 1) { bottomServoPos = bottomServoPos + 0.05; @@ -47,19 +48,21 @@ topServo = topServoPos; bottomServo = bottomServoPos; Thread::wait(150); + } } //Sets and keeps motor speed matched using encoder output void SpeedBalance() { + while(1){ leftMotor.speed(leftJoystickState); rightMotor.speed(rightJoystickState); if(leftJoystickState != 0.0 && rightJoystickState != 0.0 && leftJoystickState == rightJoystickState) //only need to match speeds if they're moving in same direction { } - Thread::yield(); + } } int main()