From 4d0f3e53f4e845dd067daacf1c1086b09d825c98 Mon Sep 17 00:00:00 2001 From: Jérémy Dufour Date: Sun, 20 Apr 2008 19:55:37 +0200 Subject: * digital/io/src - fix commands name over UART to be the same as the ones over TWI ; - add commands for the arm. --- digital/io/src/main.c | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) (limited to 'digital') 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]) -- cgit v1.2.3