Mini projet LOO
Dependencies: mbed APDS_9960 mbed-rtos
Home du projet
src/cLigne.cpp@7:4b283e36b147, 2016-04-01 (annotated)
- Committer:
- clementdoreau
- Date:
- Fri Apr 01 14:30:30 2016 +0000
- Revision:
- 7:4b283e36b147
- Parent:
- 3:493dd1cf30a4
- Child:
- 8:92d0c4961a16
Ajout divers
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 | |
clementdoreau | 7:4b283e36b147 | 5 | cLigne::cLigne() { |
clementdoreau | 7:4b283e36b147 | 6 | // variables à 0 |
clementdoreau | 7:4b283e36b147 | 7 | _positionX = 0; |
clementdoreau | 7:4b283e36b147 | 8 | _positionY = 0; |
clementdoreau | 7:4b283e36b147 | 9 | _orientation = 1; |
clementdoreau | 7:4b283e36b147 | 10 | // Positionnement des leds |
clementdoreau | 7:4b283e36b147 | 11 | // |0|1|2|3| |
clementdoreau | 7:4b283e36b147 | 12 | _Leds[0].setPositionX(_positionX); // Led coin haut gauche |
clementdoreau | 7:4b283e36b147 | 13 | _Leds[0].setPositionY(_positionY); |
clementdoreau | 7:4b283e36b147 | 14 | _Leds[1].setPositionX(_positionX + 1); // 2eme Led à droite de la 1ere |
clementdoreau | 7:4b283e36b147 | 15 | _Leds[1].setPositionY(_positionY); |
clementdoreau | 7:4b283e36b147 | 16 | _Leds[2].setPositionX(_positionX + 2); // 3eme Led à droite de la 2eme |
clementdoreau | 7:4b283e36b147 | 17 | _Leds[2].setPositionY(_positionY); |
clementdoreau | 7:4b283e36b147 | 18 | _Leds[3].setPositionX(_positionX + 3); // 4eme Led à droite de la 3eme |
clementdoreau | 7:4b283e36b147 | 19 | _Leds[3].setPositionY(_positionY); |
Willheisen | 3:493dd1cf30a4 | 20 | } |
Willheisen | 3:493dd1cf30a4 | 21 | |
clementdoreau | 7:4b283e36b147 | 22 | cLigne::cLigne(unsigned char x, unsigned char y) { |
clementdoreau | 7:4b283e36b147 | 23 | // variables à 0 |
clementdoreau | 7:4b283e36b147 | 24 | _positionX = x; |
clementdoreau | 7:4b283e36b147 | 25 | _positionY = y; |
clementdoreau | 7:4b283e36b147 | 26 | _orientation = 1; |
clementdoreau | 7:4b283e36b147 | 27 | // Positionnement des leds |
clementdoreau | 7:4b283e36b147 | 28 | // |0|1|2|3| |
clementdoreau | 7:4b283e36b147 | 29 | _Leds[0].setPositionX(_positionX); // Led coin haut gauche |
clementdoreau | 7:4b283e36b147 | 30 | _Leds[0].setPositionY(_positionY); |
clementdoreau | 7:4b283e36b147 | 31 | _Leds[1].setPositionX(_positionX + 1); // 2eme Led à droite de la 1ere |
clementdoreau | 7:4b283e36b147 | 32 | _Leds[1].setPositionY(_positionY); |
clementdoreau | 7:4b283e36b147 | 33 | _Leds[2].setPositionX(_positionX + 2); // 3eme Led à droite de la 2eme |
clementdoreau | 7:4b283e36b147 | 34 | _Leds[2].setPositionY(_positionY); |
clementdoreau | 7:4b283e36b147 | 35 | _Leds[3].setPositionX(_positionX + 3); // 4eme Led à droite de la 3eme |
clementdoreau | 7:4b283e36b147 | 36 | _Leds[3].setPositionY(_positionY); |
Willheisen | 3:493dd1cf30a4 | 37 | } |
Willheisen | 3:493dd1cf30a4 | 38 | |
clementdoreau | 7:4b283e36b147 | 39 | cLigne::~cLigne(){ |
clementdoreau | 7:4b283e36b147 | 40 | |
clementdoreau | 7:4b283e36b147 | 41 | } |
clementdoreau | 7:4b283e36b147 | 42 | |
clementdoreau | 7:4b283e36b147 | 43 | void cLigne::rotationHoraire() { |
clementdoreau | 7:4b283e36b147 | 44 | |
clementdoreau | 7:4b283e36b147 | 45 | } |