Bert Gereels / Mbed 2 deprecated ProjectOne

Dependencies:   C12832 LM75B mbed EthernetInterface mbed-rtos

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers rgb.h Source File

rgb.h

00001 #pragma once
00002 
00003 #include "mbed.h"
00004 #include <string>
00005 
00006 #define MAX_ARRAY_LENGTH_RGB 7
00007 
00008 namespace ProjectOne{
00009     
00010     class RGB{
00011         public:
00012             /*
00013             * Constructor for RGB class.
00014             *
00015             @param The pins that are connected to the RGB on the application board.
00016             @return Nothing.
00017             */
00018             RGB(PinName firstPin=p23, PinName secondPin=p24, PinName thirdPin=p25);
00019             
00020             /*
00021             * Method turns on the LED according to the given color.
00022             *
00023             @param A string containing the color to be displayed.
00024             @return Nothing.
00025             */
00026             void turnOnLed(string kleur);
00027         private:
00028             const static float r_values[MAX_ARRAY_LENGTH_RGB];
00029             const static float g_values[MAX_ARRAY_LENGTH_RGB];
00030             const static float b_values[MAX_ARRAY_LENGTH_RGB];
00031             PwmOut r;
00032             PwmOut g;
00033             PwmOut b;
00034             int determineRgbIndex(string kleur);
00035     };
00036 };