summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJérémy Dufour2009-05-08 21:40:01 +0200
committerJérémy Dufour2009-05-08 21:40:01 +0200
commit19b713ca60d4192d83d0f97ac0f21b1a1c64d3fc (patch)
treedd2e7ce46546cc1d56331a7337dd36e1268171c3
parent73c73c4a2c56ce76299c7a0631d4e1c3bae9b720 (diff)
* digital/io/src:
- integrate the servo pos module (initialization and usage with serial protocol).
-rw-r--r--digital/io/src/main.c12
1 files changed, 12 insertions, 0 deletions
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;