With this RGB class you can control a RGB-LED. You can also control a RGB-LED with a Color object.

Dependents:   coap

rgb.h

Committer:
de_geeter_alexander
Date:
2015-12-25
Revision:
0:b6d24e2f118b

File content as of revision 0:b6d24e2f118b:

#ifndef RGB_H
#define RGB_H
#include "mbed.h"
#include "color.h"
#include "LM75B.h"

class RGB{
    
    
    public:
    
    RGB(PinName r_pin, PinName g_pin, PinName b_pin);
    void setColor(Color color);
    void setColor(int red, int green, int blue);
    void setColor(int color);
    void off();
    
    private:
    PwmOut* r_out;
    PwmOut* g_out;
    PwmOut* b_out;
    float toFloat(int floater);
    };

#endif