PES 4 - Smart Medication Dispenser / PES4_ProgrammeforDesignReview2

Dependencies:   SDFileSystem mbed

Fork of PES4_Programme by PES 4 - Smart Medication Dispenser

Revision:
11:e8a7a4a9af05
Parent:
10:1f327f8aa4dd
Child:
12:f28a798d2661
--- a/source/functions.cpp	Sun Mar 25 21:38:38 2018 +0000
+++ b/source/functions.cpp	Mon Mar 26 08:21:27 2018 +0000
@@ -1,4 +1,15 @@
 #include "functions.h"
 
-void setLED(char button, char color) {}
+void setLED(char button, uint32_t color)
+{
+    float red =     ((color >> 16) & 0xff)/2.55;
+    float green =   ((color >> 8) & 0xff)/2.55;
+    float blue =    (color & 0xff)/2.55;
+    
+    //PWM channel 9-15
+    setPWM(9+(3-3*button) , red);
+    setPWM(9+(3-3*button)+1 , green);
+    setPWM(9+(3-3*button)+2 , blue);
+
+}
 void setValvePosition(char pos) {}
\ No newline at end of file