RGB LED Class

Dependencies:   mbed

Fork of RGBLED by Steven Cheldelin

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers rgbled.h Source File

rgbled.h

00001 #ifndef __RGBLED_H__
00002 #define __RGBLED_H__
00003 
00004 // includes
00005 #include "mbed.h"
00006 
00007 // defines
00008 enum color {none, red, green, blue};
00009 
00010 // rgb led
00011 class rgbled {
00012 private:
00013     DigitalOut _pin_red;
00014     DigitalOut _pin_green;
00015     DigitalOut _pin_blue;
00016     bool _on;
00017     bool _off;
00018     void _none(void);
00019     void _red(void);
00020     void _green(void);
00021     void _blue(void);
00022 public:
00023     rgbled(PinName pin_red, PinName pin_green, PinName pin_blue);
00024     void active(bool a);
00025     void set(color c);
00026 };
00027 
00028 #endif