summaryrefslogtreecommitdiff
path: root/n/es/src/tourelle.c
diff options
context:
space:
mode:
Diffstat (limited to 'n/es/src/tourelle.c')
-rw-r--r--n/es/src/tourelle.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/n/es/src/tourelle.c b/n/es/src/tourelle.c
index 62f037f..d906853 100644
--- a/n/es/src/tourelle.c
+++ b/n/es/src/tourelle.c
@@ -28,7 +28,7 @@ const uint8_t delayMax = 125;
const uint8_t delayMin = 175;
const uint8_t pin_sharp = 3 ;
uint8_t delay = 0;
-const uint8_t SEUIL = 280; // 10 cm = 2.25V et 80 cm = 1.75 V
+//extern uint16_t SEUIL = 280; // 10 cm = 2.25Vnet 80 cm = 1.75 V
const uint8_t MILIEU = 2;
// const int8_t PROUT = 12; A VERIFIER !!
@@ -49,6 +49,8 @@ extern uint8_t envoie;
extern uint8_t sens;
+extern uint8_t mesure;
+
uint8_t valeur_actuelle1 = 0;
uint8_t valeur_actuelle2 = 0;
uint8_t angle_actuel1 = 0;
@@ -130,10 +132,9 @@ void crenaux(uint8_t temps, uint8_t port, uint8_t pin)
delay_us(10L);
}
PORTD &= ~_BV (7); // on remet l'impulsion à 0
- rs232_putc('C');
}
-void rs232_callback (uint8_t cmd, uint8_t size,uint8_t* args)
+void proto_callback (uint8_t cmd, uint8_t size,uint8_t* args)
{
#define c(cmd, size) (cmd << 8 | size)
switch (c (cmd, size))
@@ -200,14 +201,12 @@ SIGNAL (SIG_OVERFLOW1)
TIMSK &= ~(0x04);
- rs232_putc('3');
for(i=0;i<(MILIEU*2+1);i++)
{
if(temp < tableau_longueur [i]) temp = tableau_longueur[i];
}
tableau_longueur[0] = mesurer();
- proto_send1w ('S',tableau_longueur[0]);
/*
if(temp == tableau_longueur[MILIEU+1] && temp > SEUIL )
{
@@ -233,6 +232,6 @@ SIGNAL (SIG_OVERFLOW1)
TournerTourelle ();
etat = 1;
- rs232_putc('4');
+ mesure = 1;
}