]> git.droids-corp.org - aversive.git/blobdiff - projects/microb2010/cobboard/actuator.c
fix race on state machines
[aversive.git] / projects / microb2010 / cobboard / actuator.c
index 6811854a3e97a2c9cea034b6e58c191db7133335..8a15ca941e3f46293d671801a2123589d4813917 100644 (file)
 #include "main.h"
 #include "actuator.h"
 
-#define COBROLLER_SPEED 800
+#define COBROLLER_SPEED 1200
+//#define COBROLLER_SPEED 600
 //#define COBROLLER_SPEED 400
 
-#define SERVO_DOOR_OPEN 260
-#define SERVO_DOOR_CLOSED 510
-#define SERVO_DOOR_BLOCK 510
+#define SERVO_DOOR_OPEN 300
+#define SERVO_DOOR_CLOSED 530
+#define SERVO_DOOR_BLOCK 530
 
 #define SERVO_CARRY_L_OPEN 295
-#define SERVO_CARRY_L_CLOSED 400 // 510
+#define SERVO_CARRY_L_CLOSED 440//400 // 510
 
 #define SERVO_CARRY_R_OPEN 455
-#define SERVO_CARRY_R_CLOSED 350 // 250
+#define SERVO_CARRY_R_CLOSED 310//350 // 250
 
 void actuator_init(void);
 
@@ -103,7 +104,16 @@ void cobroller_off(uint8_t side)
                cobboard.right_cobroller_speed = 0;
 }
 
-void actuator_init(void)
+void cobroller_reverse(uint8_t side)
 {
+       if (side == I2C_LEFT_SIDE)
+               cobboard.left_cobroller_speed = -COBROLLER_SPEED;
+       else
+               cobboard.right_cobroller_speed = COBROLLER_SPEED;
+}
 
+void actuator_init(void)
+{
+       servo_door_open();
+       servo_carry_open();
 }