Ciryk Popeye / RGB-Led
Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers rgb.h Source File

rgb.h

00001 #ifndef RGB_H
00002 #define RGB_H
00003 
00004 #include "mbed.h"
00005 #include "color.h"
00006 
00007 /** RGB-Led class
00008  *  A RGB-LED class to control RGB-Leds
00009  */ 
00010 class RGB
00011 {
00012     
00013     
00014     public : 
00015         /** Create RGB instance
00016          */
00017         RGB(PinName r_pin, PinName g_pin, PinName b_pin);
00018         
00019         /** setColor instance
00020         *This will set the color
00021          */
00022         void setColor(Color*color);
00023         /** setColor instance with RGB
00024         *This will set the color with given values red, green, blue
00025          */
00026         void setColor(int red, int green, int blue);
00027         /** setColor instance with integer color
00028         *This will set the color with given integer
00029          */
00030         void setColor(int color);
00031         
00032         /** getColor instance
00033         *This will return the current color in a Color* object
00034          */
00035         Color*getColor();
00036         
00037         /** Off instance
00038         *This will turn off all the leds
00039          */
00040         void Off();
00041         
00042         /** pinNames r_pin declaration
00043         *Declaration of PinName r_pin
00044          */
00045         PinName r_pin;
00046         /** pinNames b_pin declaration
00047         *Declaration of PinName b_pin
00048          */
00049          PinName b_pin;
00050          /** pinNames g_pin declaration
00051         *Declaration of PinName g_pin
00052          */
00053         PinName g_pin;
00054         /** color declaration of type Color*
00055         *Declaration of Color* color
00056          */ 
00057         Color*color;
00058         /** invertColor instance
00059         *This will invert every color
00060          */ 
00061         void invertColor(Color* color);
00062         /** PwmOut r_out declaration
00063         *Declaration of PwmOut r_out
00064          */
00065         PwmOut* r_out;
00066         /** PwmOut b_out declaration
00067         *Declaration of PwmOut b_out
00068          */
00069         PwmOut* b_out;
00070         /** PwmOut g_out declaration
00071         *Declaration of PwmOut g_out
00072          */
00073         PwmOut* g_out;
00074         /** static const int MAX_COLOR_VALUE
00075         *Sets the maximum color value, 255 for RGB
00076          */
00077         static const int MAX_COLOR_VALUE = 255;
00078         
00079 };
00080 
00081 #endif