Two simple classes for using the RGB led
Dependents: 4180-lab3-RTOS 4180-FinalProject
Diff: SimpleRGB.h
- Revision:
- 0:7a3ee33c0a53
- Child:
- 1:0008e30a2bda
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/SimpleRGB.h Mon Oct 10 00:32:31 2016 +0000 @@ -0,0 +1,31 @@ +#ifndef SIMPLERGB_H +#define SIMPLERGB_H + +#include "mbed.h" + +class LightColor +{ + public: + LightColor(float r, float g, float b); + float red; + float green; + float blue; +}; + +class RGBLed +{ + public: + RGBLed(PinName rpin, PinName gpin, PinName bpin); + void write(float red, float green, float blue); + void write(LightColor color); + + private: + PwmOut _rpin; + PwmOut _gpin; + PwmOut _bpin; +}; + +#endif + + + \ No newline at end of file