Led_driver

Dependencies:   TLC5940 mbed

Fork of TLC5940ServoTest by Andrew Duda

Revision:
5:022819ad9a5f
Parent:
4:8fc1281b08fa
--- a/main.cpp	Mon Mar 06 13:47:17 2017 +0000
+++ b/main.cpp	Tue Mar 21 11:59:37 2017 +0000
@@ -2,12 +2,14 @@
 #include "TLC5940.h"
 
 // Create the TLC5940 instance
-TLC5940 tlc(p7, p5, p21, p9, p10, p11, p12, 1);
+TLC5940 tlc(p7, p5, p21, p9, p10, p11, p12, 2); //(SCLK, MOSI, GSCLK, BLANK, XLAT, DCPRG, VPRG, const int number)
 Serial pc(USBTX, USBRX);             // (tx, rx)
 
 int i =0;
 int f =0;
-unsigned short GSData[16] = { 0x0000 };
+int d =0;
+unsigned short GSData[32] = { 0x0000 };
+unsigned char DCData[10] = { 0x00 };
 
 
 void run()
@@ -15,14 +17,14 @@
    
 
 
-    while(i < 16) {
-        wait(0.1);
+    while(i < 32) {
+        wait(0.4);
         GSData[i] = 0xFFF;
         tlc.setNewGSData(GSData);
         ++i;
     }//while1
 
-    pc.printf("16 erreicht \n");
+    pc.printf("32 erreicht \n");
     pc.printf("%d\n", i);
     
     
@@ -35,7 +37,7 @@
         pc.printf("while_2= %d\n", i);
         --i;
         wait(0.1);
-        GSData[i] = 0x1F4;
+        GSData[i] = 0x000;
         tlc.setNewGSData(GSData);
     }//while2
 
@@ -48,12 +50,13 @@
 {
     while(1)
     {
-        
+        DCData[d] = 0xFF;
+        tlc.setNewDCData(DCData);
         run();
-        wait(1);
+        wait(0.2);
         printf("Status \n");
         run2();
-        wait(1);
+        wait(0.2);
     }//while
 
 }//main