Commit 9348158f5fbf26f856c57461e0599c38cd3e9405
1 parent
bcd81fea
Modification des commentaires
Showing
2 changed files
with
12 additions
and
17 deletions
Show diff stats
Moteur/Moteur.c
... | ... | @@ -9,18 +9,16 @@ |
9 | 9 | #define MOVE_LEFT 0x08 |
10 | 10 | #define MOVE_STOP 0x10 |
11 | 11 | |
12 | -//******************************************* | |
13 | -// Init of PWM signal deliverd on pin 9 (PB1) | |
14 | -//******************************************* | |
12 | + | |
13 | +// Initialisation du signal PWM délivré sur le pin9 (PB1) | |
15 | 14 | void init_pwm() |
16 | 15 | { |
17 | - // initialize | |
18 | - cli(); // disable global interrupts | |
19 | - | |
16 | + | |
17 | + cli(); | |
20 | 18 | |
21 | - //initialisation pwm sur broche 13 = PB1 | |
19 | + //Initialisation du PWM sur broche 13 = PB1 | |
22 | 20 | DDRB |= 0x02 ; |
23 | - // PD6 is now an output | |
21 | + // PD6 est une sortie | |
24 | 22 | TCCR1A = (1 << WGM10) | (1 << COM1A1); |
25 | 23 | // set none-inverting mode |
26 | 24 | TCCR1B = (1 << WGM12) | (1 << CS10) |(1 << CS12); |
... | ... | @@ -28,7 +26,7 @@ void init_pwm() |
28 | 26 | OCR1A= 0xFF ; |
29 | 27 | |
30 | 28 | DDRB |= (1 << DDB1)|(1 << DDB2); |
31 | - // PB1 and PB2 is now an output | |
29 | + // PB1 and PB2 sont des sorties | |
32 | 30 | |
33 | 31 | TCCR1B |= (1 << CS10); |
34 | 32 | // START the timer with no prescaler |
... | ... | @@ -36,9 +34,8 @@ void init_pwm() |
36 | 34 | sei(); |
37 | 35 | } |
38 | 36 | |
39 | -//*********************************************************************** | |
40 | -// Set of functions resulting movement to a servomotor connected on pin 9. | |
41 | -//*********************************************************************** | |
37 | +// Fonctions pour le mouvement d'un servomoteur connecté sur le pin9 | |
38 | + | |
42 | 39 | void motor_right(){ |
43 | 40 | OCR1A = 0x80 ; |
44 | 41 | } |
... | ... | @@ -51,9 +48,7 @@ void motor_stop(){ |
51 | 48 | OCR1A = 0xFF; |
52 | 49 | } |
53 | 50 | |
54 | -//********************************** | |
55 | -// Functions for the led management | |
56 | -//********************************** | |
51 | +// Fonctions pour la LED | |
57 | 52 | |
58 | 53 | void init_led(void){ |
59 | 54 | //Led must be placed on pin 7 (PD7) |
... | ... | @@ -73,7 +68,7 @@ int main(void) |
73 | 68 | { |
74 | 69 | init_led(); |
75 | 70 | init_serial(9600); //on choisit une vitesse de 9600 bauds pour la transmission série |
76 | - uint8_t r ; | |
71 | + uint8_t r ; | |
77 | 72 | init_pwm(); |
78 | 73 | while(1) |
79 | 74 | { | ... | ... |
Moteur/serial.c
... | ... | @@ -15,7 +15,7 @@ UCSR0C = (1<<UCSZ01 | 1<<UCSZ00); |
15 | 15 | UCSR0A &= ~(1 << U2X0); |
16 | 16 | } |
17 | 17 | |
18 | -void send_serial(uint8_t c) //envoyer un carctère sur le port série | |
18 | +void send_serial(uint8_t c) //envoyer un caractère sur le port série | |
19 | 19 | { |
20 | 20 | loop_until_bit_is_set(UCSR0A, UDRE0); |
21 | 21 | UDR0 = c; | ... | ... |