X-Git-Url: http://git.droids-corp.org/?p=aversive.git;a=blobdiff_plain;f=projects%2Fmicrob2010%2Fballboard%2Factuator.c;h=d745fa08552aac92869d9b42e0a88b2dd8c517f5;hp=367e241d273cc458661930cc4a137d0333d13cfa;hb=063af91cd38fceba6cbcf3a9b8abd4c48684d990;hpb=8d6a47e9e21a9a31f4bc12d32fb3d11091a4b305 diff --git a/projects/microb2010/ballboard/actuator.c b/projects/microb2010/ballboard/actuator.c index 367e241..d745fa0 100644 --- a/projects/microb2010/ballboard/actuator.c +++ b/projects/microb2010/ballboard/actuator.c @@ -40,5 +40,56 @@ #include +#include "actuator.h" #include "main.h" +#define ROLLER_ON -ROLLER_SPEED +#define ROLLER_OFF 0 +#define ROLLER_REVERSE ROLLER_SPEED + +#define FORKROT_DEPLOYED -50000 +#define FORKROT_PACKED 0 + +#define FORKTRANS_LEFT 0 +#define FORKTRANS_MIDDLE 500 +#define FORKTRANS_RIGHT 1000 + +void roller_on(void) +{ + cs_set_consign(&ballboard.roller.cs, ROLLER_ON); +} + +void roller_off(void) +{ + cs_set_consign(&ballboard.roller.cs, ROLLER_OFF); +} + +void roller_reverse(void) +{ + cs_set_consign(&ballboard.roller.cs, ROLLER_REVERSE); +} + +void fork_deploy(void) +{ + cs_set_consign(&ballboard.forkrot.cs, FORKROT_DEPLOYED); +} + +void fork_pack(void) +{ + cs_set_consign(&ballboard.forkrot.cs, FORKROT_PACKED); +} + +void fork_left(void) +{ + cs_set_consign(&ballboard.forktrans.cs, FORKTRANS_LEFT); +} + +void fork_right(void) +{ + cs_set_consign(&ballboard.forktrans.cs, FORKTRANS_RIGHT); +} + +void fork_middle(void) +{ + cs_set_consign(&ballboard.forktrans.cs, FORKTRANS_MIDDLE); +}