Led functions for the LPC1768 Ledbar

Files at this revision

API Documentation at this revision

Comitter:
lordofthestorm12
Date:
Fri Nov 23 15:26:36 2018 +0000
Commit message:
LED class;

Changed in this revision

Led_Func_Lib.h Show annotated file Show diff for this revision Revisions of this file
diff -r 000000000000 -r c203a5ca6463 Led_Func_Lib.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Led_Func_Lib.h	Fri Nov 23 15:26:36 2018 +0000
@@ -0,0 +1,49 @@
+#ifndef LED_FUNC_LIB_H
+#define LED_FUNC_LIB_H
+
+#include "mbed.h"
+
+const int LAUFLICHT[] = {0x00, 0x01, 0x02, 0x04, 0x08, 0x06, 0x09 ,0x0f};
+
+class Led_Func
+{
+
+public:
+    Led_Func(): _Led(LED1, LED2, LED3, LED4) {
+        _Led = LAUFLICHT[0];
+    }
+
+    void setLED(int aLED) {
+        switch(aLED) {
+            case (0):
+                _Led = LAUFLICHT[0];
+                break; // LED Aus
+            case (1):
+                _Led = LAUFLICHT[1];
+                break; // Led1
+            case (2):
+                _Led = LAUFLICHT[2];
+                break; // Led2
+            case (3):
+                _Led = LAUFLICHT[3];
+                break; // Led3
+            case (4):
+                _Led = LAUFLICHT[4];
+                break; // Led4
+            case (5):
+                _Led = LAUFLICHT[5];
+                break; // Led 1 und 4
+            case (6):
+                _Led = LAUFLICHT[6];
+                break; // Led 2 und 3
+            case (7):
+                _Led = LAUFLICHT[7];
+                break; // alle Led's
+        }
+    }
+
+private:
+    BusOut _Led;
+};
+
+#endif
\ No newline at end of file