From 19b713ca60d4192d83d0f97ac0f21b1a1c64d3fc Mon Sep 17 00:00:00 2001 From: Jérémy Dufour Date: Fri, 8 May 2009 21:40:01 +0200 Subject: * digital/io/src: - integrate the servo pos module (initialization and usage with serial protocol). --- digital/io/src/main.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'digital') diff --git a/digital/io/src/main.c b/digital/io/src/main.c index 3e1c8ec3..760dc5d3 100644 --- a/digital/io/src/main.c +++ b/digital/io/src/main.c @@ -145,6 +145,8 @@ main_init (void) sharp_init (); /* PWM module */ pwm_init (); + /* Servo pos init. */ + servo_pos_init (); /* io initialization done */ proto_send0 ('z'); @@ -361,8 +363,18 @@ proto_callback (uint8_t cmd, uint8_t size, uint8_t *args) * - 1b: high time value for position 0; * - ... */ + servo_pos_set_high_time (args[0], &args[1]); break; + case c ('P', 2): + /* Set the high time values of a servo for the positions + * - 1b: servo id number; + * - 1b: servo position number; + */ + servo_pos_move_to (args[0], args[1]); + break; + + case c ('s', 2): /* Set servo motor to a desired position using the servo module. * - 1b: servo id number; -- cgit v1.2.3