Led_driver

Dependencies:   TLC5940 mbed

Fork of TLC5940ServoTest by Andrew Duda

Files at this revision

API Documentation at this revision

Comitter:
ODEM
Date:
Mon Mar 06 13:47:17 2017 +0000
Parent:
3:ad4dfe34cfcd
Child:
5:022819ad9a5f
Commit message:
Led_Treiber_Lauflicht_v1.0

Changed in this revision

TLC5940.lib Show annotated file Show diff for this revision Revisions of this file
TLC5940Servo.lib Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/TLC5940.lib	Mon Mar 06 13:47:17 2017 +0000
@@ -0,0 +1,1 @@
+http://developer.mbed.org/users/Spencer/code/TLC5940/#e5ed5650eb15
--- a/TLC5940Servo.lib	Tue Oct 21 15:06:20 2014 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-http://developer.mbed.org/users/dudanian/code/TLC5940Servo/#b001282e967b
--- a/main.cpp	Tue Oct 21 15:06:20 2014 +0000
+++ b/main.cpp	Mon Mar 06 13:47:17 2017 +0000
@@ -1,20 +1,59 @@
-#include "mbed.h"
-#include "TLC5940Servo.h"
-
-TLC5940Servo tlc(p5, p7, p8, p9, p21);
-
-int main()
-{   
-    // Calibrate the 5th motor
-    tlc[5].calibrate(0.0006, 40.0);
-    while (1) {
-        for (float i = 0.0; i <= 1.01; i += 0.05) {
-            tlc[5] = i; // assigning
-            printf("%f\n\r", (float)tlc[5]); // reading
-            wait (0.1);
-        }
-        wait(0.5);
-        tlc[5] = 0.0;
-        wait(0.5);
-    }
-}
\ No newline at end of file
+#include "mbed.h"
+#include "TLC5940.h"
+
+// Create the TLC5940 instance
+TLC5940 tlc(p7, p5, p21, p9, p10, p11, p12, 1);
+Serial pc(USBTX, USBRX);             // (tx, rx)
+
+int i =0;
+int f =0;
+unsigned short GSData[16] = { 0x0000 };
+
+
+void run()
+{
+   
+
+
+    while(i < 16) {
+        wait(0.1);
+        GSData[i] = 0xFFF;
+        tlc.setNewGSData(GSData);
+        ++i;
+    }//while1
+
+    pc.printf("16 erreicht \n");
+    pc.printf("%d\n", i);
+    
+    
+}
+
+void run2()
+{
+    pc.printf("i= %d\n", i);
+    while(i > 0) {
+        pc.printf("while_2= %d\n", i);
+        --i;
+        wait(0.1);
+        GSData[i] = 0x1F4;
+        tlc.setNewGSData(GSData);
+    }//while2
+
+    pc.printf("0 erreicht \n");
+   
+   
+}
+
+int main()
+{
+    while(1)
+    {
+        
+        run();
+        wait(1);
+        printf("Status \n");
+        run2();
+        wait(1);
+    }//while
+
+}//main