Mini projet LOO

Dependencies:   mbed APDS_9960 mbed-rtos

Dependents:   MoveYourTetris_OK

Home du projet

src/cLed.cpp

Committer:
clementdoreau
Date:
2016-04-01
Revision:
7:4b283e36b147
Parent:
5:d6b0bf27bac6
Child:
9:6f3d8b714a59

File content as of revision 7:4b283e36b147:

#include "cLed.h"

// Définition de la classe Led

// CONSTRUCTEURS

cLed::cLed() {
	_positionX = 0;
	_positionY = 0;
	_couleur = 0x00;
}

cLed::cLed(unsigned char x, unsigned char y) {
	_positionX = x;
	_positionY = y;
}

cLed::cLed(unsigned char x, unsigned char y, unsigned char c) {
	_positionX = x;
	_positionY = y;
	_couleur = c;
}

// GETTERS

unsigned char cLed::getPositionX() {
	return _positionX;
}
unsigned char cLed::getPositionY() {
	return _positionY;
}

unsigned char cLed::getCouleur() {
	return _couleur;
}

// SETTER

void cLed::setPositionX(unsigned char x) {
	_positionX = x;
}

void cLed::setPositionY(unsigned char y) {
	_positionY = y;
}

void cLed::allumer(unsigned char c) {
	_couleur = c;
	/*DigitalOut cs(p14);
	 SPI point(p11,p12,p13);
	 cs=0;
	 wait(0.5);
	 for(char i=0; i<_positionX; i++)
	 {
	 for(char j=0; j<_positionY; j++)
	 {
	 point.write(c);
	 }
	 }
	 wait(0.5);
	 cs=1;*/
}

void cLed::eteindre() {
	_couleur = LED_NOIR;
}