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:
- 6:b957d8809e7c
- Parent:
- 5:73bfad06b775
- Child:
- 12:61759f94c07a
diff -r 73bfad06b775 -r b957d8809e7c actuators.cpp --- a/actuators.cpp Mon Oct 05 17:35:02 2015 +0200 +++ b/actuators.cpp Mon Oct 05 17:51:59 2015 +0200 @@ -1,4 +1,30 @@ // functions for controlling the motors +bool motorEnable = false; + +bool direction1 = false; // CCW is false(positive rotation), CW is true (neg rotation) +bool direction2 = false; + +double motor1Pos = 0; +double motor2Pos = 0; + +double motorSpeed1 = 0; +double motorSpeed2 = 0; + +double motorSetSpeed1 = 0; +double motorSetSpeed2 = 0; + + +double motorPWM1 = 0; +double motorPWM2 = 0; + +// Set PID values +double Kp1 = 1; +double Ki1 = 1; +double Kd1 = 1; + +double Kp2 = 1; +double Ki2 = 1; +double Kd2 = 1; void motorInit(){ // Initialze motors