my version of the RGBLed library. NOTHING changed, just wanted to put into my account.
Fork of RGBLed by
Diff: RGBLed.cpp
- Revision:
- 3:be0a3c2ec426
- Child:
- 4:176363412797
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/RGBLed.cpp Wed Sep 03 10:13:45 2014 +0000 @@ -0,0 +1,23 @@ +#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); \ No newline at end of file