Mini projet LOO
Dependencies: mbed APDS_9960 mbed-rtos
Home du projet
Diff: src/cEl.cpp
- Revision:
- 11:c37922a0a915
- Parent:
- 10:9ef3f520ff6c
- Child:
- 12:7afdbc7465ac
diff -r 9ef3f520ff6c -r c37922a0a915 src/cEl.cpp --- a/src/cEl.cpp Thu Apr 07 15:24:07 2016 +0000 +++ b/src/cEl.cpp Sun Apr 10 17:46:03 2016 +0000 @@ -19,6 +19,7 @@ _Leds[2].setPositionY(_positionY); _Leds[3].setPositionX(_positionX + 1); _Leds[3].setPositionY(_positionY); + } cEl::cEl(unsigned char x, unsigned char y) @@ -26,6 +27,7 @@ // variables à 0 _positionX = x; _positionY = y; + _orientation = 1; // Positionnement des leds // |1|2|3| @@ -38,6 +40,16 @@ _Leds[2].setPositionY(_positionY); _Leds[3].setPositionX(_positionX + 1); _Leds[3].setPositionY(_positionY); + for(unsigned char i = 0; i<4;i++) + { + _Leds[i].setOldPositionX(_Leds[i].getPositionX()); + } + for(unsigned char i = 0; i<4;i++) + { + _Leds[i].setOldPositionY(_Leds[i].getPositionY()); + } + //////////////////////////////////////////////////////// + _typeForme = 4; } @@ -45,7 +57,7 @@ void cEl::rotationHoraire() { // Sauvegarde des anciennes positions - for(unsigned char i = 0; i < 4; i++) { + for (unsigned char i = 0; i < 4; i++) { _Leds[i].setOldPositionX(_Leds[i].getPositionX()); _Leds[i].setOldPositionY(_Leds[i].getPositionY()); }