Mini projet LOO

Dependencies:   mbed APDS_9960 mbed-rtos

Dependents:   MoveYourTetris_OK

Home du projet

Committer:
clementdoreau
Date:
Wed Apr 20 15:09:43 2016 +0000
Revision:
29:95469b25e187
Parent:
10:9ef3f520ff6c
Child:
30:c647da947bd9
Mise a jour de l'envoi du nombre de matrices

Who changed what in which revision?

UserRevisionLine numberNew 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 29:95469b25e187 13 cLed::cLed(unsigned int x, unsigned int y) {
clementdoreau 7:4b283e36b147 14 _positionX = x;
clementdoreau 7:4b283e36b147 15 _positionY = y;
clementdoreau 1:ab5f440f4156 16 }
clementdoreau 1:ab5f440f4156 17
clementdoreau 29:95469b25e187 18 cLed::cLed(unsigned int x, unsigned 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 29:95469b25e187 26 unsigned int cLed::getPositionX() {
clementdoreau 7:4b283e36b147 27 return _positionX;
clementdoreau 1:ab5f440f4156 28 }
clementdoreau 29:95469b25e187 29 unsigned int cLed::getPositionY() {
clementdoreau 7:4b283e36b147 30 return _positionY;
clementdoreau 1:ab5f440f4156 31 }
clementdoreau 1:ab5f440f4156 32
clementdoreau 29:95469b25e187 33 unsigned int cLed::getOldPositionX(){
clementdoreau 10:9ef3f520ff6c 34 return _oldPositionX;
clementdoreau 10:9ef3f520ff6c 35 }
clementdoreau 10:9ef3f520ff6c 36
clementdoreau 29:95469b25e187 37 unsigned 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 29:95469b25e187 48 void cLed::setPositionX(unsigned int x) {
clementdoreau 7:4b283e36b147 49 _positionX = x;
clementdoreau 1:ab5f440f4156 50 }
clementdoreau 1:ab5f440f4156 51
clementdoreau 29:95469b25e187 52 void cLed::setPositionY(unsigned int y) {
clementdoreau 7:4b283e36b147 53 _positionY = y;
clementdoreau 1:ab5f440f4156 54 }
clementdoreau 1:ab5f440f4156 55
clementdoreau 29:95469b25e187 56 void cLed::setOldPositionX(unsigned int x){
clementdoreau 10:9ef3f520ff6c 57 _oldPositionX = x;
clementdoreau 10:9ef3f520ff6c 58 }
clementdoreau 10:9ef3f520ff6c 59
clementdoreau 29:95469b25e187 60 void cLed::setOldPositionY(unsigned 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