From 49b774a83268980be4820595c63a5de7a9e65097 Mon Sep 17 00:00:00 2001 From: dufourj Date: Thu, 25 May 2006 13:38:23 +0000 Subject: Servo motor - personnaliser par servo. --- n/es-2006/src/servo_motor.c | 13 ++++++++----- n/es-2006/src/servo_motor.h | 8 ++++---- 2 files changed, 12 insertions(+), 9 deletions(-) (limited to 'n') diff --git a/n/es-2006/src/servo_motor.c b/n/es-2006/src/servo_motor.c index 288f78f..9112067 100644 --- a/n/es-2006/src/servo_motor.c +++ b/n/es-2006/src/servo_motor.c @@ -41,7 +41,7 @@ #define SRVM_TOTEML_PIN 3 /* first totem */ #define SRVM_TOTEMR_PIN 2 /* second totem */ /** Table for the time spend by each servo in high position. */ -volatile uint8_t servo_time[3] = { SRVM_TRASH_POS_CLOSE, SRVM_POS_IN, SRVM_POS_IN }; +volatile uint8_t servo_time[3] = { SRVM_TRASH_POS_CLOSE, SRVM_LEFT_POS_IN, SRVM_RIGHT_POS_IN }; /** Different states of this module. */ #define SRVM_STATE_SLEEP 0 @@ -87,10 +87,13 @@ servo_motor_set_pos (uint8_t servo_mask, uint8_t servo_pos) if (num == 0) UTILS_BOUND (servo_time[num], SRVM_TRASH_POS_OPEN, SRVM_TRASH_POS_CLOSE); - /* Totem* */ - else - UTILS_BOUND (servo_time[num], SRVM_POS_IN, - SRVM_POS_OUT); + /* Totem1 */ + else if (num == 1) + UTILS_BOUND (servo_time[num], SRVM_LEFT_POS_IN, + SRVM_LEFT_POS_OUT); + else if (num == 2) + UTILS_BOUND (servo_time[num], SRVM_RIGHT_POS_IN, + SRVM_RIGHT_POS_OUT); } } diff --git a/n/es-2006/src/servo_motor.h b/n/es-2006/src/servo_motor.h index 1f5c1d6..adc5fc8 100644 --- a/n/es-2006/src/servo_motor.h +++ b/n/es-2006/src/servo_motor.h @@ -30,10 +30,10 @@ #include "common.h" /** All the states used to comunicate with this module. */ -#define SRVM_POS_IN 40 -#define SRVM_POS_OUT 143 -#define SRVM_POS_MIDDLE 91 - +#define SRVM_LEFT_POS_IN 40 +#define SRVM_LEFT_POS_OUT 143 +#define SRVM_RIGHT_POS_IN 40 +#define SRVM_RIGHT_POS_OUT 143 #define SRVM_TRASH_POS_OPEN 68 /* 44 */ #define SRVM_TRASH_POS_CLOSE 100 /* 64 */ -- cgit v1.2.3