Mini projet LOO

Dependencies:   mbed APDS_9960 mbed-rtos

Dependents:   MoveYourTetris_OK

Home du projet

Committer:
Willheisen
Date:
Wed Apr 06 21:53:55 2016 +0000
Revision:
9:6f3d8b714a59
Parent:
7:4b283e36b147
Child:
10:9ef3f520ff6c
rotationHoraire pour le L; m?thodes d?placements Bas, Gauche, Droite; ;

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 7:4b283e36b147 13 cLed::cLed(unsigned char x, unsigned char y) {
clementdoreau 7:4b283e36b147 14 _positionX = x;
clementdoreau 7:4b283e36b147 15 _positionY = y;
clementdoreau 1:ab5f440f4156 16 }
clementdoreau 1:ab5f440f4156 17
clementdoreau 7:4b283e36b147 18 cLed::cLed(unsigned char x, unsigned char y, unsigned char 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 7:4b283e36b147 26 unsigned char cLed::getPositionX() {
clementdoreau 7:4b283e36b147 27 return _positionX;
clementdoreau 1:ab5f440f4156 28 }
clementdoreau 7:4b283e36b147 29 unsigned char cLed::getPositionY() {
clementdoreau 7:4b283e36b147 30 return _positionY;
clementdoreau 1:ab5f440f4156 31 }
clementdoreau 1:ab5f440f4156 32
clementdoreau 7:4b283e36b147 33 unsigned char cLed::getCouleur() {
clementdoreau 7:4b283e36b147 34 return _couleur;
clementdoreau 1:ab5f440f4156 35 }
clementdoreau 1:ab5f440f4156 36
clementdoreau 1:ab5f440f4156 37 // SETTER
clementdoreau 1:ab5f440f4156 38
clementdoreau 7:4b283e36b147 39 void cLed::setPositionX(unsigned char x) {
clementdoreau 7:4b283e36b147 40 _positionX = x;
clementdoreau 1:ab5f440f4156 41 }
clementdoreau 1:ab5f440f4156 42
clementdoreau 7:4b283e36b147 43 void cLed::setPositionY(unsigned char y) {
clementdoreau 7:4b283e36b147 44 _positionY = y;
clementdoreau 1:ab5f440f4156 45 }
clementdoreau 1:ab5f440f4156 46
clementdoreau 7:4b283e36b147 47 void cLed::allumer(unsigned char c) {
clementdoreau 7:4b283e36b147 48 _couleur = c;
clementdoreau 1:ab5f440f4156 49 }
clementdoreau 1:ab5f440f4156 50
clementdoreau 7:4b283e36b147 51 void cLed::eteindre() {
clementdoreau 7:4b283e36b147 52 _couleur = LED_NOIR;
clementdoreau 1:ab5f440f4156 53 }