summaryrefslogtreecommitdiffhomepage
path: root/digital/io
diff options
context:
space:
mode:
authorNicolas Schodet2009-05-23 00:09:23 +0200
committerNicolas Schodet2009-05-23 00:09:23 +0200
commitd6647a90f4bfe59968cf0f94443335f2673a32f3 (patch)
tree7f51af2ed63cd149346b420928857974e561d903 /digital/io
parent8f3f3cea26f03d5c3979dd594ff02e7d6d49da54 (diff)
* digital/asserv, digital/io:
- added usage of center sensor.
Diffstat (limited to 'digital/io')
-rw-r--r--digital/io/doc/proto_asserv.txt4
-rw-r--r--digital/io/src/asserv.c9
-rw-r--r--digital/io/src/top_cb.c2
3 files changed, 11 insertions, 4 deletions
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);
}