summaryrefslogtreecommitdiff
path: root/n
diff options
context:
space:
mode:
authordufourj2006-05-25 13:38:23 +0000
committerdufourj2006-05-25 13:38:23 +0000
commit49b774a83268980be4820595c63a5de7a9e65097 (patch)
treea53932a860a6b9cc44328fdbd0d8a0f0a0e6ffad /n
parentcff3099b9d8f619304c9f6294f9b58aea4fe5e04 (diff)
Servo motor
- personnaliser par servo.
Diffstat (limited to 'n')
-rw-r--r--n/es-2006/src/servo_motor.c13
-rw-r--r--n/es-2006/src/servo_motor.h8
2 files changed, 12 insertions, 9 deletions
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 */