Ciryk Popeye / RGB-Led

rgb.h

Committer:
ciryk
Date:
2015-12-10
Revision:
3:c6e16ad073f6
Parent:
2:37ffab5933a1
Child:
4:630bc0ac793a

File content as of revision 3:c6e16ad073f6:

#ifndef RGB_H
#define RGB_H

#include "mbed.h"
#include "color.h"

/** My HelloWorld class.
 *  Used for printing "Hello World" on USB serial.
 */ 
class RGB
{
    
    
    public : 
        /** Create RGB instance
         */
        RGB(PinName r_pin, PinName g_pin, PinName b_pin);
        
        /** setColor instance
        *This will set the color
         */
        void setColor(Color*color);
        /** setColor instance with RGB
        *This will set the color with given values red, green, blue
         */
        void setColor(int red, int green, int blue);
        void setColor(int color);
        
        Color*getColor();
        
        void Off();
        
        PinName r_pin, b_pin, g_pin;
            
        Color*color;
        
        void invertColor(Color* color);
        
        PwmOut* r_out;
        PwmOut* b_out;
        PwmOut* g_out;
        
        static const int MAX_COLOR_VALUE = 255;
        
};

#endif