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.c15
1 files changed, 9 insertions, 6 deletions
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<temps;delay_crenaux++)
+ {
+ delay_us(10L);
+ }
port &= 0xFF - pin; // on remet l'impulsion à 0
}