From d6647a90f4bfe59968cf0f94443335f2673a32f3 Mon Sep 17 00:00:00 2001 From: Nicolas Schodet Date: Sat, 23 May 2009 00:09:23 +0200 Subject: * digital/asserv, digital/io: - added usage of center sensor. --- digital/io/doc/proto_asserv.txt | 4 ++++ digital/io/src/asserv.c | 9 ++++++--- digital/io/src/top_cb.c | 2 +- 3 files changed, 11 insertions(+), 4 deletions(-) (limited to 'digital/io') diff --git a/digital/io/doc/proto_asserv.txt b/digital/io/doc/proto_asserv.txt index fe21bdad..9fcf9808 100644 --- a/digital/io/doc/proto_asserv.txt +++ b/digital/io/doc/proto_asserv.txt @@ -73,6 +73,10 @@ This table describe the list of supported commands by the *asserv* card: | 'f' | Move | - direction (b) | Go to the wall | | | | | - direction: 0 = forward, 1 = backward | +---------+-------+-----------------+------------------------------------------+ +| 'g' | Move | - direction (b) | Go to the wall, using center sensor | +| | | - delay (b) | - direction: 0 = forward, 1 = backward | +| | | | - delay: center sensor trigger delay | ++---------+-------+-----------------+------------------------------------------+ | 'F' | Move | None | Go to a distributor (forward movement) | +---------+-------+-----------------+------------------------------------------+ | 'x' | Move | - x (3b) | Go to an absolute position | diff --git a/digital/io/src/asserv.c b/digital/io/src/asserv.c index 6f849054..0853a11b 100644 --- a/digital/io/src/asserv.c +++ b/digital/io/src/asserv.c @@ -503,7 +503,7 @@ asserv_goto_xya (uint32_t x, uint32_t y, int16_t a, uint8_t backward) asserv_twi_send_command ('X', 9); } -/* Go to the wall (moving backward). */ +/* Go to the wall. */ void asserv_go_to_the_wall (uint8_t backward) { @@ -517,8 +517,11 @@ asserv_go_to_the_wall (uint8_t backward) void asserv_go_to_distributor (void) { - /* Send the go the distributor command to the asserv board */ - asserv_twi_send_command ('F', 0); + /* Put direction and delay as parameters */ + asserv_twi_buffer_param[0] = 0; + asserv_twi_buffer_param[1] = 25; + /* Send the go the wall command to the asserv board */ + asserv_twi_send_command ('g', 2); } /* Move the arm. */ diff --git a/digital/io/src/top_cb.c b/digital/io/src/top_cb.c index ce6d6db4..0530ae97 100644 --- a/digital/io/src/top_cb.c +++ b/digital/io/src/top_cb.c @@ -743,7 +743,7 @@ top__CLEAN_FRONT_OF_DISTRIBUTOR__move_fsm_succeed (void) /* Open cylinder. */ cylinder_close_order = 0; /* Fuck the distributor. */ - asserv_go_to_the_wall (0); + asserv_go_to_distributor (); return top_next (CLEAN_FRONT_OF_DISTRIBUTOR, move_fsm_succeed); } -- cgit v1.2.3