Sille Van Landschoot / RGB-fun

Dependents:   m3Dpi MQTT-Thermostat-example Final_project_Tran Final_project_Tran ... more

Revision:
6:b5a88296bc50
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/RGB.h.orig	Thu Nov 19 08:16:58 2015 +0000
@@ -0,0 +1,38 @@
+
+#include "mbed.h"
+#include "Color.h"
+
+#ifndef RGB_H
+#define RGB_H
+
+class RGB
+{
+public:
+
+    static const int OFF = 0;
+
+    RGB(PinName r_pin, PinName g_pin, PinName b_pin);
+    ~RGB();
+    // void setIntensity(int intensity); // How are we gonna do this?
+    void setColor(Color* color);
+    void setColor(int color);
+    Color* getColor();
+
+    // void on(); // do we need this? what value to turn on to?
+    void off();
+
+protected:
+    //void setColor(int r, int g, int b);
+
+private:
+    PwmOut* r_out;
+    PwmOut* g_out;
+    PwmOut* b_out;
+
+    Color* color;
+
+    void setPwmColor(int value, PwmOut* output);
+
+};
+
+#endif