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:
- 0:525558a26464
- Child:
- 1:80f098c05d4b
diff -r 000000000000 -r 525558a26464 actuators.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/actuators.cpp Mon Sep 28 13:54:34 2015 +0000 @@ -0,0 +1,37 @@ +// functions for controlling the motors + +void motorInit(){ + + } + + +void motorControl(){ + if(motorEnable == HIGH){ // only run motors if switch is enabled + // get encoder positions + // check if motor's are within rotational boundarys + // calculate encoder speeds + // translate to x/y speed + // compute new PID parameters using setpoint speeds and x/y speeds + // write new values to motor's + + }else{ + // write 0 to motors + } +} + +void servoControl(){ + // use potMeter Value to set servo angle + // (optionaly calculate xy position to keep balloon in position) + // calculate z position using angle + // calculate x y translation of endpoint + // find new x and y speed. + + } + +void pumpControl(){ + if (pumpButton == HIGH){ + // write pumpPin High + }else{ + // write pumpPin Low + } + } \ No newline at end of file