Hello world for the TLC5940Servo library.

Dependencies:   TLC5940Servo mbed

main.cpp

Committer:
dudanian
Date:
2014-10-21
Revision:
3:ad4dfe34cfcd
Parent:
2:faa25eaa18dd

File content as of revision 3:ad4dfe34cfcd:

#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);
    }
}