work on trajectory, update cobboard and ballboard too
[aversive.git] / projects / microb2010 / mainboard / actuator.c
index 19d2fc7..777d94a 100644 (file)
@@ -31,7 +31,7 @@
 #include <pwm_ng.h>
 #include <timer.h>
 #include <scheduler.h>
 #include <pwm_ng.h>
 #include <timer.h>
 #include <scheduler.h>
-#include <time.h>
+#include <clock_time.h>
 
 #include <pid.h>
 #include <quadramp.h>
 
 #include <pid.h>
 #include <quadramp.h>
@@ -48,6 +48,7 @@
 #include <rdline.h>
 
 #include "main.h"
 #include <rdline.h>
 
 #include "main.h"
+#include "robotsim.h"
 
 void pwm_set_and_save(void *pwm, int32_t val)
 {
 
 void pwm_set_and_save(void *pwm, int32_t val)
 {
@@ -62,16 +63,30 @@ void pwm_set_and_save(void *pwm, int32_t val)
                mainboard.pwm_l = val;
        else if (pwm == RIGHT_PWM)
                mainboard.pwm_r = val;
                mainboard.pwm_l = val;
        else if (pwm == RIGHT_PWM)
                mainboard.pwm_r = val;
+#ifdef HOST_VERSION
+       robotsim_pwm(pwm, val);
+#else
        pwm_ng_set(pwm, val);
        pwm_ng_set(pwm, val);
+#endif
 }
 
 }
 
-void pickup_wheels_on(void)
+void support_balls_deploy(void)
 {
 {
-       mainboard.enable_pickup_wheels = 1;
+#ifndef HOST_VERSION
+       pwm_ng_set(SUPPORT_BALLS_R_SERVO, 510);
+       pwm_ng_set(SUPPORT_BALLS_L_SERVO, 205);
+#endif
 }
 
 }
 
-void pickup_wheels_off(void)
+void support_balls_pack(void)
 {
 {
-       mainboard.enable_pickup_wheels = 0;
+#ifndef HOST_VERSION
+       pwm_ng_set(SUPPORT_BALLS_R_SERVO, 250);
+       pwm_ng_set(SUPPORT_BALLS_L_SERVO, 480);
+#endif
 }
 
 }
 
+void actuator_init(void)
+{
+
+}