Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: m3Dpi MQTT-Thermostat-example Final_project_Tran Final_project_Tran ... more
Diff: RGB.h.orig
- Revision:
- 6:b5a88296bc50
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/RGB.h.orig Thu Nov 19 08:16:58 2015 +0000 @@ -0,0 +1,38 @@ + +#include "mbed.h" +#include "Color.h" + +#ifndef RGB_H +#define RGB_H + +class RGB +{ +public: + + static const int OFF = 0; + + RGB(PinName r_pin, PinName g_pin, PinName b_pin); + ~RGB(); + // void setIntensity(int intensity); // How are we gonna do this? + void setColor(Color* color); + void setColor(int color); + Color* getColor(); + + // void on(); // do we need this? what value to turn on to? + void off(); + +protected: + //void setColor(int r, int g, int b); + +private: + PwmOut* r_out; + PwmOut* g_out; + PwmOut* b_out; + + Color* color; + + void setPwmColor(int value, PwmOut* output); + +}; + +#endif