my version of the RGBLed library. NOTHING changed, just wanted to put into my account.

Fork of RGBLed by Romain Berrada

RGBLed.cpp

Committer:
rominos2
Date:
2014-09-03
Revision:
3:be0a3c2ec426
Child:
4:176363412797

File content as of revision 3:be0a3c2ec426:

#include "RGBLed.h"

RGBLed::Color::Color(bool r, bool g, bool b) : _r(r), _g(g), _b(b) {
}

RGBLed::RGBLed(PinName redPin, PinName greenPin, PinName bluePin) : _red(redPin), _green(greenPin), _blue(bluePin) {
    this->setColor(RGBLed::BLACK); // Clear the LED output
}

void RGBLed::setColor(Color& color) {
    _red = color._r;
    _green = color._g;
    _blue = color._b;
}

RGBLed::Color RGBLed::BLACK = RGBLed::Color(1,1,1);
RGBLed::Color RGBLed::RED = RGBLed::Color(0,1,1);
RGBLed::Color RGBLed::GREEN = RGBLed::Color(1,0,1);
RGBLed::Color RGBLed::BLUE = RGBLed::Color(1,1,0);
RGBLed::Color RGBLed::MAGENTA = RGBLed::Color(0,1,0);
RGBLed::Color RGBLed::CYAN = RGBLed::Color(1,0,0);
RGBLed::Color RGBLed::YELLOW = RGBLed::Color(0,0,1);
RGBLed::Color RGBLed::WHITE = RGBLed::Color(0,0,0);