just ledcontrol

Fork of ledControl2 by Baser Kandehir

Revision:
0:0afc4bd76407
Child:
1:7ffaf6e46589
diff -r 000000000000 -r 0afc4bd76407 ledControl.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ledControl.cpp	Thu Jul 09 12:14:46 2015 +0000
@@ -0,0 +1,44 @@
+#include "ledControl.h"
+
+DigitalOut led1(LED1);
+DigitalOut led2(LED2);
+DigitalOut led3(LED3);
+DigitalOut led4(LED4);
+
+// Controls the 4 LEDs on the LPC1768
+void ledControl(int ledNum,int value)
+{
+  switch(ledNum)
+  {
+    case 1: led1.write(value);
+    break;
+    
+    case 2: led2.write(value);
+    break;
+    
+    case 3: led3.write(value);
+    break;
+    
+    case 4: led4.write(value);
+    break;
+  }  
+}
+
+// Toggles the specified led
+void ledToggle(int ledNum)
+{
+  switch(ledNum)
+  {
+    case 1: led1=!led1;
+    break;
+    
+    case 2: led2=!led2;
+    break;
+    
+    case 3: led3=!led3;
+    break;
+    
+    case 4: led4=!led4;
+    break;
+  }     
+}
\ No newline at end of file