Led_driver

Dependencies:   TLC5940 mbed

Fork of TLC5940ServoTest by Andrew Duda

Revision:
1:aeb0ed70cbd0
Parent:
0:0b054b47ac3d
Child:
2:faa25eaa18dd
--- a/main.cpp	Tue Oct 21 02:36:27 2014 +0000
+++ b/main.cpp	Tue Oct 21 06:05:45 2014 +0000
@@ -1,51 +1,18 @@
 #include "mbed.h"
 #include "TLC5940Servo.h"
-#include "Servo.h"
 
 TLC5940Servo tlc(p5, p7, p8, p9, p21);
-Servo serv();
-
-
 
 int main()
 {   
-    // Enable the first LED
-    tlc[5] = 0xFFF;
-    int val = 0;
-    int sw = 0;
-    
+    // Calibrate the 5th motor
+    tlc.calibrate(5, 0.0006, 40.0);
     while (1) {
-        switch (sw) {
-        case 0:
-            tlc[5] = 0x0fff;
-            break;
-        case 1:
-            tlc[5] = 0x0f8f;
-            break;
-        case 2:
-            tlc[5] = 0x0f0f;
-            break;
+        for (float i = 0.0; i < 1.0; i += 0.05) {
+            tlc[5] = i; // assigning
+            printf("%f\n\r", tlc[5]); // reading
+            wait (0.1);
         }
-        sw = (sw + 1) % 3;
-        printf("%d\n\r", tlc[5]);
         wait(1.0);
     }
-    
-    /*while(1)
-    {
-        if (sw){
-            tlc[5] = val++;
-            if (val >= 0x0FFF)
-            sw = 0;
-        }
-        else {
-            tlc[5] = val--;
-            if (val <= 0)
-            sw = 1;
-        }
-        printf("%d\n\r", val);
-        wait(0.01);
-    }*/
-    
-    
-} // write 203 307 409 for -40, 0, +40 degrees
\ No newline at end of file
+}
\ No newline at end of file