Mini projet LOO
Dependencies: mbed APDS_9960 mbed-rtos
Home du projet
src/cLigne.cpp@3:493dd1cf30a4, 2016-03-30 (annotated)
- Committer:
- Willheisen
- Date:
- Wed Mar 30 10:22:07 2016 +0000
- Revision:
- 3:493dd1cf30a4
- Child:
- 7:4b283e36b147
30/03/2016 12:22 wilfried
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Willheisen | 3:493dd1cf30a4 | 1 | // Définition de la classe Ligne |
Willheisen | 3:493dd1cf30a4 | 2 | |
Willheisen | 3:493dd1cf30a4 | 3 | #include "cLigne.h" |
Willheisen | 3:493dd1cf30a4 | 4 | |
Willheisen | 3:493dd1cf30a4 | 5 | cLigne::cLigne() |
Willheisen | 3:493dd1cf30a4 | 6 | { |
Willheisen | 3:493dd1cf30a4 | 7 | // variables à 0 |
Willheisen | 3:493dd1cf30a4 | 8 | _positionX= 0; |
Willheisen | 3:493dd1cf30a4 | 9 | _positionY = 0; |
Willheisen | 3:493dd1cf30a4 | 10 | _orientation = 1; |
Willheisen | 3:493dd1cf30a4 | 11 | // Positionnement des leds |
Willheisen | 3:493dd1cf30a4 | 12 | // |0|1|2|3| |
Willheisen | 3:493dd1cf30a4 | 13 | _Leds[0].setPositionX(_positionX); // Led coin haut gauche |
Willheisen | 3:493dd1cf30a4 | 14 | _Leds[0].setPositionY(_positionY); |
Willheisen | 3:493dd1cf30a4 | 15 | _Leds[1].setPositionX(_positionX + 1); // 2eme Led à droite de la 1ere |
Willheisen | 3:493dd1cf30a4 | 16 | _Leds[1].setPositionY(_positionY); |
Willheisen | 3:493dd1cf30a4 | 17 | _Leds[2].setPositionX(_positionX + 2); // 3eme Led à droite de la 2eme |
Willheisen | 3:493dd1cf30a4 | 18 | _Leds[2].setPositionY(_positionY); |
Willheisen | 3:493dd1cf30a4 | 19 | _Leds[3].setPositionX(_positionX + 3); // 4eme Led à droite de la 3eme |
Willheisen | 3:493dd1cf30a4 | 20 | _Leds[3].setPositionY(_positionY); |
Willheisen | 3:493dd1cf30a4 | 21 | } |
Willheisen | 3:493dd1cf30a4 | 22 | |
Willheisen | 3:493dd1cf30a4 | 23 | cLigne::cLigne(unsigned char x, unsigned char y) |
Willheisen | 3:493dd1cf30a4 | 24 | { |
Willheisen | 3:493dd1cf30a4 | 25 | // variables à 0 |
Willheisen | 3:493dd1cf30a4 | 26 | _positionX= x; |
Willheisen | 3:493dd1cf30a4 | 27 | _positionY = y; |
Willheisen | 3:493dd1cf30a4 | 28 | _orientation = 1; |
Willheisen | 3:493dd1cf30a4 | 29 | // Positionnement des leds |
Willheisen | 3:493dd1cf30a4 | 30 | // |0|1|2|3| |
Willheisen | 3:493dd1cf30a4 | 31 | _Leds[0].setPositionX(_positionX); // Led coin haut gauche |
Willheisen | 3:493dd1cf30a4 | 32 | _Leds[0].setPositionY(_positionY); |
Willheisen | 3:493dd1cf30a4 | 33 | _Leds[1].setPositionX(_positionX + 1); // 2eme Led à droite de la 1ere |
Willheisen | 3:493dd1cf30a4 | 34 | _Leds[1].setPositionY(_positionY); |
Willheisen | 3:493dd1cf30a4 | 35 | _Leds[2].setPositionX(_positionX + 2); // 3eme Led à droite de la 2eme |
Willheisen | 3:493dd1cf30a4 | 36 | _Leds[2].setPositionY(_positionY); |
Willheisen | 3:493dd1cf30a4 | 37 | _Leds[3].setPositionX(_positionX + 3); // 4eme Led à droite de la 3eme |
Willheisen | 3:493dd1cf30a4 | 38 | _Leds[3].setPositionY(_positionY); |
Willheisen | 3:493dd1cf30a4 | 39 | } |
Willheisen | 3:493dd1cf30a4 | 40 |