Jens Vanhove / RgbLED

Dependencies:   C12832

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 #include "PinNames.h"
00005 #include "mbed.h"
00006 
00007 /** \brief A wrapper for an RGB LED connected to a PWM. This class simplifies the
00008   *        setting of the color and also provides some basic color definitions.
00009  */
00010 class RGBLed
00011 {
00012 public:
00013     RGBLed(PinName redPin, PinName greenPin, PinName bluePin);
00014 
00015     /** \Brief Initialize the LED */
00016     void init();
00017     
00018     /** \Brief Set the color of the RGB LED */
00019     void setColor(const float red, const float green, const float blue);
00020 
00021 private:
00022     PwmOut m_red;
00023     PwmOut m_green;
00024     PwmOut m_blue;
00025 };
00026 
00027 #endif