From 71564bd2908facb66710ab7454ad5b00025f21f6 Mon Sep 17 00:00:00 2001 From: dalmais Date: Sun, 17 Apr 2005 02:52:03 +0000 Subject: dernière version avant le test sur TAZ. pret pour le débuggage et le pot offert par Tb --- n/es/src/main.c | 4 ++-- n/es/src/tourelle.c | 15 +++++++++------ 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/n/es/src/main.c b/n/es/src/main.c index 6b1f5ce..76e3b67 100644 --- a/n/es/src/main.c +++ b/n/es/src/main.c @@ -48,7 +48,7 @@ int main (void) /// intialisation rs232_init (); - twi_init (0x02); /// A CHANGER + twi_init (0x02); tourelle_init (prescaler); adc_init (); sei (); @@ -59,7 +59,7 @@ int main (void) { if(etat == 1) { - etat = 0; // a 0 normalement=> TEST + etat = 0; TCNT1 = (65535L - ((20L*14745600L)/(1024L*1000L))); if(temp_sens != sens) { diff --git a/n/es/src/tourelle.c b/n/es/src/tourelle.c index 54e69a0..1a65864 100644 --- a/n/es/src/tourelle.c +++ b/n/es/src/tourelle.c @@ -60,15 +60,15 @@ uint8_t nombre_ancien = 0; void tourelle_init (uint16_t prescaler) { delay = 0; - DDRB = 0xFF; + DDRB = 0x07; SFIOR |= 0x01; // prescaler autorisé crenaux(delay,PORTB,7); // on met le capteur à 0° -// wait_1ms(20); + delay_ms(20L); crenaux(delay,PORTB,7); -// wait_1ms(20); + delay_ms(20L); crenaux(delay,PORTB,7); @@ -106,9 +106,12 @@ void tourelle_init (uint16_t prescaler) void crenaux(uint8_t temps, uint8_t port, uint8_t pin) { - - port |= pin; // en admettant que je sois sur le portb et la troisième pin -// wait_10us(temp); // TROUVER LA FONCTION !!!!!!!! + uint8_t delay_crenaux = 0; + port |= pin; // en admettant que je sois sur le portb et la troisième pin + for(delay_crenaux=0;delay_crenaux