Hello world for the TLC5940Servo library.

Dependencies:   TLC5940Servo mbed

Files at this revision

API Documentation at this revision

Comitter:
dudanian
Date:
Tue Oct 21 02:36:27 2014 +0000
Child:
1:aeb0ed70cbd0
Commit message:
Created.

Changed in this revision

TLC5940Servo.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/TLC5940Servo.lib	Tue Oct 21 02:36:27 2014 +0000
@@ -0,0 +1,1 @@
+http://developer.mbed.org/users/dudanian/code/TLC5940Servo/#ba4e0390f72e
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Tue Oct 21 02:36:27 2014 +0000
@@ -0,0 +1,51 @@
+#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;
+    
+    while (1) {
+        switch (sw) {
+        case 0:
+            tlc[5] = 0x0fff;
+            break;
+        case 1:
+            tlc[5] = 0x0f8f;
+            break;
+        case 2:
+            tlc[5] = 0x0f0f;
+            break;
+        }
+        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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Tue Oct 21 02:36:27 2014 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/552587b429a1
\ No newline at end of file