Part One of my Project Course. Implementation of simple I/O and a custom defined protocol over UDP/IP.

Dependencies:   C12832 LM75B mbed EthernetInterface mbed-rtos

rgb.h

Committer:
bertgereels
Date:
2018-03-23
Revision:
3:538e17979246
Parent:
2:6bfe732ba6bc

File content as of revision 3:538e17979246:

#pragma once

#include "mbed.h"
#include <string>

#define MAX_ARRAY_LENGTH_RGB 7

namespace ProjectOne{
    
    class RGB{
        public:
            /*
            * Constructor for RGB class.
            *
            @param The pins that are connected to the RGB on the application board.
            @return Nothing.
            */
            RGB(PinName firstPin=p23, PinName secondPin=p24, PinName thirdPin=p25);
            
            /*
            * Method turns on the LED according to the given color.
            *
            @param A string containing the color to be displayed.
            @return Nothing.
            */
            void turnOnLed(string kleur);
        private:
            const static float r_values[MAX_ARRAY_LENGTH_RGB];
            const static float g_values[MAX_ARRAY_LENGTH_RGB];
            const static float b_values[MAX_ARRAY_LENGTH_RGB];
            PwmOut r;
            PwmOut g;
            PwmOut b;
            int determineRgbIndex(string kleur);
    };
};