From 2d0f9967c6e3e8d7a15012b5f7648f5bccef531b Mon Sep 17 00:00:00 2001 From: Jérémy Dufour Date: Thu, 21 May 2009 18:00:06 +0200 Subject: * digital/io/src: - add a second position to unload pucks on the main circle. --- digital/io/src/top.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/digital/io/src/top.c b/digital/io/src/top.c index 04633bf8..a6ec42ce 100644 --- a/digital/io/src/top.c +++ b/digital/io/src/top.c @@ -140,15 +140,18 @@ void top_get_next_position_to_unload_puck (asserv_position_t *position) { /* TODO: enahnce. */ + static uint8_t index = 0; static const asserv_position_t unload[] = { { 1500, 600, 270 }, + { 1500, 2100 - 600, 90 }, }; /* Sanity check. */ if (position) { - position->x = PG_X_VALUE_COMPUTING (unload->x); - position->y = unload->y; - position->a = PG_A_VALUE_COMPUTING (unload->a * BOT_ANGLE_DEGREE); + position->x = PG_X_VALUE_COMPUTING (unload[index].x); + position->y = unload[index].y; + position->a = PG_A_VALUE_COMPUTING (unload[index].a * BOT_ANGLE_DEGREE); + index = (index + 1) % 2; } } -- cgit v1.2.3