Mini projet LOO
Dependencies: mbed APDS_9960 mbed-rtos
Home du projet
src/cLed.cpp@30:c647da947bd9, 2016-04-21 (annotated)
- Committer:
- clementdoreau
- Date:
- Thu Apr 21 12:33:58 2016 +0000
- Revision:
- 30:c647da947bd9
- Parent:
- 29:95469b25e187
marche pas
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
clementdoreau | 1:ab5f440f4156 | 1 | #include "cLed.h" |
clementdoreau | 1:ab5f440f4156 | 2 | |
clementdoreau | 1:ab5f440f4156 | 3 | // Définition de la classe Led |
clementdoreau | 1:ab5f440f4156 | 4 | |
clementdoreau | 1:ab5f440f4156 | 5 | // CONSTRUCTEURS |
clementdoreau | 1:ab5f440f4156 | 6 | |
clementdoreau | 7:4b283e36b147 | 7 | cLed::cLed() { |
clementdoreau | 7:4b283e36b147 | 8 | _positionX = 0; |
clementdoreau | 7:4b283e36b147 | 9 | _positionY = 0; |
clementdoreau | 7:4b283e36b147 | 10 | _couleur = 0x00; |
clementdoreau | 1:ab5f440f4156 | 11 | } |
clementdoreau | 1:ab5f440f4156 | 12 | |
clementdoreau | 30:c647da947bd9 | 13 | cLed::cLed(int x, int y) { |
clementdoreau | 7:4b283e36b147 | 14 | _positionX = x; |
clementdoreau | 7:4b283e36b147 | 15 | _positionY = y; |
clementdoreau | 1:ab5f440f4156 | 16 | } |
clementdoreau | 1:ab5f440f4156 | 17 | |
clementdoreau | 30:c647da947bd9 | 18 | cLed::cLed(int x, int y, unsigned int c) { |
clementdoreau | 7:4b283e36b147 | 19 | _positionX = x; |
clementdoreau | 7:4b283e36b147 | 20 | _positionY = y; |
clementdoreau | 7:4b283e36b147 | 21 | _couleur = c; |
clementdoreau | 1:ab5f440f4156 | 22 | } |
clementdoreau | 1:ab5f440f4156 | 23 | |
clementdoreau | 1:ab5f440f4156 | 24 | // GETTERS |
clementdoreau | 1:ab5f440f4156 | 25 | |
clementdoreau | 30:c647da947bd9 | 26 | int cLed::getPositionX() { |
clementdoreau | 7:4b283e36b147 | 27 | return _positionX; |
clementdoreau | 1:ab5f440f4156 | 28 | } |
clementdoreau | 30:c647da947bd9 | 29 | int cLed::getPositionY() { |
clementdoreau | 7:4b283e36b147 | 30 | return _positionY; |
clementdoreau | 1:ab5f440f4156 | 31 | } |
clementdoreau | 1:ab5f440f4156 | 32 | |
clementdoreau | 30:c647da947bd9 | 33 | int cLed::getOldPositionX(){ |
clementdoreau | 10:9ef3f520ff6c | 34 | return _oldPositionX; |
clementdoreau | 10:9ef3f520ff6c | 35 | } |
clementdoreau | 10:9ef3f520ff6c | 36 | |
clementdoreau | 30:c647da947bd9 | 37 | int cLed::getOldPositionY(){ |
clementdoreau | 10:9ef3f520ff6c | 38 | return _oldPositionY; |
clementdoreau | 10:9ef3f520ff6c | 39 | } |
clementdoreau | 10:9ef3f520ff6c | 40 | |
clementdoreau | 29:95469b25e187 | 41 | unsigned int cLed::getCouleur() { |
clementdoreau | 7:4b283e36b147 | 42 | return _couleur; |
clementdoreau | 1:ab5f440f4156 | 43 | } |
clementdoreau | 1:ab5f440f4156 | 44 | |
clementdoreau | 10:9ef3f520ff6c | 45 | |
clementdoreau | 1:ab5f440f4156 | 46 | // SETTER |
clementdoreau | 1:ab5f440f4156 | 47 | |
clementdoreau | 30:c647da947bd9 | 48 | void cLed::setPositionX( int x) { |
clementdoreau | 7:4b283e36b147 | 49 | _positionX = x; |
clementdoreau | 1:ab5f440f4156 | 50 | } |
clementdoreau | 1:ab5f440f4156 | 51 | |
clementdoreau | 30:c647da947bd9 | 52 | void cLed::setPositionY(int y) { |
clementdoreau | 7:4b283e36b147 | 53 | _positionY = y; |
clementdoreau | 1:ab5f440f4156 | 54 | } |
clementdoreau | 1:ab5f440f4156 | 55 | |
clementdoreau | 30:c647da947bd9 | 56 | void cLed::setOldPositionX(int x){ |
clementdoreau | 10:9ef3f520ff6c | 57 | _oldPositionX = x; |
clementdoreau | 10:9ef3f520ff6c | 58 | } |
clementdoreau | 10:9ef3f520ff6c | 59 | |
clementdoreau | 30:c647da947bd9 | 60 | void cLed::setOldPositionY(int y){ |
clementdoreau | 10:9ef3f520ff6c | 61 | _oldPositionY = y; |
clementdoreau | 10:9ef3f520ff6c | 62 | } |
clementdoreau | 10:9ef3f520ff6c | 63 | |
clementdoreau | 29:95469b25e187 | 64 | void cLed::setCouleur(unsigned int c) { |
clementdoreau | 7:4b283e36b147 | 65 | _couleur = c; |
clementdoreau | 1:ab5f440f4156 | 66 | } |
clementdoreau | 1:ab5f440f4156 | 67 |