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:
- 97:0f67952051e5
- Parent:
- 93:a8898eb80edc
diff -r a8898eb80edc -r 0f67952051e5 actuators.cpp --- a/actuators.cpp Wed Oct 21 13:16:24 2015 +0200 +++ b/actuators.cpp Wed Oct 21 13:50:38 2015 +0200 @@ -47,13 +47,12 @@ double timechange; bool pidOut = 0; - // for Calibration: + // calibration bool calibrating1 = true; bool calibrating2 = false; double motorCalSpeed = 10; // deg/sec double returnSpeed = -10; bool springHit = false; - float lastCall = 0; // Create object instances @@ -211,12 +210,9 @@ } } } - now = t.read(); // call motor using timer instead of wait - if(now - lastCall > motorCall){ - writeMotors(); - lastCall = now; - } - + writeMotors(); + wait(motorCall); + } safetyOn = true; // turn safety on after callibration }