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.c51
1 files changed, 9 insertions, 42 deletions
diff --git a/n/es/src/tourelle.c b/n/es/src/tourelle.c
index d906853..e2d4ba9 100644
--- a/n/es/src/tourelle.c
+++ b/n/es/src/tourelle.c
@@ -24,8 +24,8 @@
#include "tourelle.h"
#include "avr/signal.h"
-const uint8_t delayMax = 125;
-const uint8_t delayMin = 175;
+const uint8_t delayMax = 100;
+const uint8_t delayMin = 200;
const uint8_t pin_sharp = 3 ;
uint8_t delay = 0;
//extern uint16_t SEUIL = 280; // 10 cm = 2.25Vnet 80 cm = 1.75 V
@@ -42,14 +42,13 @@ const uint8_t MILIEU = 2;
uint16_t tableau_longueur[25];
extern uint8_t continu;
-
extern uint8_t etat;
-
extern uint8_t envoie;
-
extern uint8_t sens;
-
extern uint8_t mesure;
+extern uint8_t pont;
+extern uint8_t clk;
+extern uint8_t ascenseur;
uint8_t valeur_actuelle1 = 0;
uint8_t valeur_actuelle2 = 0;
@@ -89,6 +88,9 @@ void tourelle_init (uint16_t prescaler)
crenaux(delay,PORTC,7);
delay_ms(20L);
+ pont = 1;
+ ascenseur = 1;
+
rs232_putc('F');
switch(prescaler)
@@ -195,43 +197,8 @@ int16_t mesurer(void)
SIGNAL (SIG_OVERFLOW1)
{
- // on fait la mesure
- uint8_t i = 0;
- uint8_t temp = 0;
-
TIMSK &= ~(0x04);
-
-
- for(i=0;i<(MILIEU*2+1);i++)
- {
- if(temp < tableau_longueur [i]) temp = tableau_longueur[i];
- }
- tableau_longueur[0] = mesurer();
- /*
- if(temp == tableau_longueur[MILIEU+1] && temp > SEUIL )
- {
- if(nombre_actuel == 0)
- {
- valeur_actuelle1 = tableau_longueur[MILIEU+1];
- angle_actuel1 = 45 + (delay - 6)*90/50;
- }
-
- if(nombre_actuel == 1)
- {
- valeur_actuelle2 = tableau_longueur[MILIEU +1];
- angle_actuel2 = 45 + (delay - 6)*90/50;
- }
-
- if(nombre_actuel > 1)
- {
-// ALARME // PROBLEME // ALLUMER LED
- }
-
- }
- */
- TournerTourelle ();
- etat = 1;
- mesure = 1;
+ clk = 1;
}