summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJérémy Dufour2008-04-20 19:55:37 +0200
committerJérémy Dufour2008-04-20 19:55:37 +0200
commit4d0f3e53f4e845dd067daacf1c1086b09d825c98 (patch)
tree602080f5247a6c5bf79c0e4bee684ae61dfa695a
parent8dac7ce374c8abe4de6defc88c60536ad0fc3bf1 (diff)
* digital/io/src
- fix commands name over UART to be the same as the ones over TWI ; - add commands for the arm.
-rw-r--r--digital/io/src/main.c28
1 files changed, 23 insertions, 5 deletions
diff --git a/digital/io/src/main.c b/digital/io/src/main.c
index 7da061bb..8b6f8d78 100644
--- a/digital/io/src/main.c
+++ b/digital/io/src/main.c
@@ -216,12 +216,12 @@ proto_callback (uint8_t cmd, uint8_t size, uint8_t *args)
getsamples_start (args[0] << 8, args[1]);
break;
- /* Asserv */
+ /* Asserv/arm */
case c ('a', 1):
{
switch (args[0])
{
- case 'f':
+ case 'w':
/* Free motor */
asserv_free_motor ();
break;
@@ -229,14 +229,18 @@ proto_callback (uint8_t cmd, uint8_t size, uint8_t *args)
/* Stop motor */
asserv_stop_motor ();
break;
- case 'w':
+ case 'f':
/* Go to the wall */
asserv_go_to_the_wall ();
break;
- case 'd':
+ case 'F':
/* Go to the distributor */
asserv_go_to_distributor ();
break;
+ case 'c':
+ /* Close the input hole with the arm */
+ asserv_close_input_hole ();
+ break;
}
}
break;
@@ -244,7 +248,7 @@ proto_callback (uint8_t cmd, uint8_t size, uint8_t *args)
{
switch (args[0])
{
- case 'r':
+ case 'y':
/* Angular move
* - 2b: angle of rotation
*/
@@ -253,6 +257,20 @@ proto_callback (uint8_t cmd, uint8_t size, uint8_t *args)
}
}
break;
+ case c ('a', 4):
+ {
+ switch (args[0])
+ {
+ case 'b':
+ /* Move the arm
+ * - 2b: offset angle ;
+ * - 1b: speed.
+ */
+ asserv_move_arm (v8_to_v16 (args[1], args[2]), args[3]);
+ break;
+ }
+ }
+ break;
case c ('a', 5):
{
switch (args[0])