Jelle Raes / Mbed 2 deprecated Projec_1_projectlab

Dependencies:   EthernetInterface LM75B mbed-rtos mbed

Fork of communication by Jelle Raes

Revision:
0:52e944ca21ea
Child:
2:067142778937
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/led.cpp	Tue Mar 13 09:40:51 2018 +0000
@@ -0,0 +1,37 @@
+#include "mbed.h"
+#include <string.h>
+#include "led.h"
+
+Serial pc3(USBTX, USBRX);
+led::led(void)
+{
+    count =4;
+    colors[0].name="red";
+    colors[0].redValue = 0.0;
+    colors[0].greenValue =1.0;
+    colors[0].blueValue =1.0;
+    
+    colors[1].name="green";
+    colors[1].redValue = 1.0;
+    colors[1].greenValue =0.0;
+    colors[1].blueValue =1.0;
+    
+    colors[2].name="blue";
+    colors[2].redValue = 1.0;
+    colors[2].greenValue =1.0;
+    colors[2].blueValue =0.0;
+    
+    colors[3].name="black";
+    colors[3].redValue = 1.0;
+    colors[3].greenValue =1.0;
+    colors[3].blueValue =1.0;
+}
+
+                
+led::COLOR led::getCOLOR(char *n){
+    led::COLOR temp;
+    for(int i=0;i<count;i++){
+            if(strcmp(colors[i].name,n) ==0)
+            temp=colors[i];}
+    return temp;
+}
\ No newline at end of file