RGB LED Class
Dependencies: mbed
Fork of RGBLED by
Diff: rgbled.h
- Revision:
- 0:7c0b6a649748
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/rgbled.h Mon Jun 09 14:17:39 2014 +0000 @@ -0,0 +1,28 @@ +#ifndef __RGBLED_H__ +#define __RGBLED_H__ + +// includes +#include "mbed.h" + +// defines +enum color {none, red, green, blue}; + +// rgb led +class rgbled { +private: + DigitalOut _pin_red; + DigitalOut _pin_green; + DigitalOut _pin_blue; + bool _on; + bool _off; + void _none(void); + void _red(void); + void _green(void); + void _blue(void); +public: + rgbled(PinName pin_red, PinName pin_green, PinName pin_blue); + void active(bool a); + void set(color c); +}; + +#endif \ No newline at end of file