Led_driver

Dependencies:   TLC5940 mbed

Fork of TLC5940ServoTest by Andrew Duda

main.cpp

Committer:
ODEM
Date:
2017-03-06
Revision:
4:8fc1281b08fa
Parent:
3:ad4dfe34cfcd
Child:
5:022819ad9a5f

File content as of revision 4:8fc1281b08fa:

#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