control for robotic arm that can play chess using a granular gripper
Dependencies: Encoder mbed HIDScope Servo MODSERIAL
Fork of chessRobot by
Diff: actuators.cpp
- Revision:
- 83:8fa05f53fc73
- Parent:
- 82:4cc8f9ad3fec
- Child:
- 84:df770ec4df61
--- a/actuators.cpp Tue Oct 20 14:30:54 2015 +0200 +++ b/actuators.cpp Tue Oct 20 14:58:55 2015 +0200 @@ -135,17 +135,17 @@ // write new values to motor's if (motor1SetSpeed > 0 ){ // CCW rotation direction1 = false; - motor1PID.SetDirection(DIRECT); // increase in input > increase in output + motor1PID.SetOutputLimits(0,1); }else{ direction1 = true; // CW rotation - motor1PID.SetDirection(REVERSE); // increase in input > decrease in output + motor1PID.SetOutputLimits(-1,0); } if (motor2SetSpeed > 0 ){ // CCW rotation direction2 = false; - motor2PID.SetDirection(DIRECT); + motor2PID.SetOutputLimits(0,1); }else{ direction2 = true; // CW rotation - motor2PID.SetDirection(REVERSE); + motor2PID.SetOutputLimits(-1,0); } motor1Dir.write(direction1); motor2Dir.write(direction2);