summaryrefslogtreecommitdiff
path: root/n/es-2007/src/main.c
diff options
context:
space:
mode:
authorcohensol2007-05-12 04:45:09 +0000
committercohensol2007-05-12 04:45:09 +0000
commite2b42cb2933028d5a15466f2ee52c6c7480d1960 (patch)
treef1ff27d0cb0439dec01b042e6af6ba6f816474e0 /n/es-2007/src/main.c
parentc7c965f96621555cfd53802d192f72a12e305f56 (diff)
Implementation des fonctions suivantes :
- detection du color switch par la commande 'c' - mise jour de la vitesse du rouleau par la commande 'R' PP
Diffstat (limited to 'n/es-2007/src/main.c')
-rw-r--r--n/es-2007/src/main.c34
1 files changed, 15 insertions, 19 deletions
diff --git a/n/es-2007/src/main.c b/n/es-2007/src/main.c
index a78241f..bc83269 100644
--- a/n/es-2007/src/main.c
+++ b/n/es-2007/src/main.c
@@ -41,7 +41,6 @@
#include "lcd.h" /* Communication with the LCD card */
#include "ack.h" /* Ack module */
#include "ascenseur.h"
-#include "capteurs.h" /*Captors sensors */
/* Statistics for RVB sensors */
uint8_t sensor_rvb_stat_enable[RVB_MAX_SENSOR], sensor_rvb_stats[RVB_MAX_SENSOR];
@@ -76,6 +75,9 @@ uint8_t lcd_key_enable, lcd_key_freq;
/* Enable stat for ack */
uint8_t main_ack_freq, main_ack_enable;
+/* Color selected by the color switch */
+uint8_t selectedColor;
+
/* Grub enable */
uint16_t grub_enable;
@@ -140,22 +142,6 @@ proto_callback (uint8_t cmd, uint8_t size, uint8_t *args)
if (temp_16b & _BV(compt))
sniff_rvb_set_ref_color (compt, args[2]);
break;
- /* Print stats of the colour seen by the sensor */
- case c ('A', 1):
- if(isRightHSActive()) args[0] = 1;
- else args[0] = 0;
- break;
-
- /* Print stats for ball */
- case c ('B',1 ):
- if(isLeftHSActive()) args[0] = 1;
- else args[0] = 0;
- break;
- /* Print stats for front RVB Sniff */
- case c ('C', 1):
- if(isBackSideActive()) args[0] = 1;
- else args[0] = 0;
- break;
/* RVB Hole sensor */
case c ('D', 1):
sniff_rvb_hole_enable = sniff_rvb_hole_stats = args[0];
@@ -207,11 +193,23 @@ proto_callback (uint8_t cmd, uint8_t size, uint8_t *args)
lcd_grub_booting ();
return;
+ /* Get color switch status*/
+ case c ('c', 0):
+ selectedColor = others_selectcoul ();
+ proto_send ('c', 1, &selectedColor);
+ break;
+
/* Ascenseur*/
case c ('a', 3):
ascenseur_bouge (args[0], args[1], args[2]);
break;
+ /* Rouleau*/
+ case c ('R', 1):
+ rouleau_bouge (args[0]);
+ break;
+
+
/* Unknown commands */
default:
proto_send0 ('?');
@@ -240,8 +238,6 @@ main (void)
others_init();
/* ascenseur init */
ascenseur_init();
- /* capteurs init */
- capteurs_init();
/* Servo motor init */
servo_motor_init ();
/* Sharp init */