Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: C12832 LM75B mbed EthernetInterface mbed-rtos
Diff: rgb.cpp
- Revision:
- 0:88d3b9015f7c
- Child:
- 1:b5c534165dfe
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/rgb.cpp	Mon Feb 26 11:25:59 2018 +0000
@@ -0,0 +1,23 @@
+#include "mbed.h"
+#include "rgb.h"
+
+namespace ProjectOne{
+    
+    const float RGB::r_values[] = {0.0, 1.0, 1.0, 0.0, 0.498, 0.0, 1.0};
+    const float RGB::g_values[] = {1.0, 0.0, 1.0, 0.353, 1.0, 0.0, 1.0};
+    const float RGB::b_values[] = {1.0, 1.0, 0.0, 1.0, 0.498, 0.0, 1.0};
+    
+    RGB::RGB(PinName r_pin, PinName g_pin, PinName b_pin) : r(r_pin), g(g_pin), b(b_pin){
+    
+    }
+    
+    //Rood = 0, Groen = 1, Blauw = 2, Oranje = 3, Paars = 4, Wit = 5, Uit = 6
+    void RGB::turnOnLed(int kleur){
+        r = r_values[kleur];
+        g = g_values[kleur];
+        b = b_values[kleur];
+    }
+    
+}
+
+