Pages: [1]   Go Down
Author Topic: independent timer / delay - tlc5940 or anywhere!  (Read 379 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Karma: 0
Posts: 15
Arduino nice
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I am currently using Peter Mackeys code to drive a tlc5940. At the moment I have 32 LEDs that fade in and out sequentially.

His code loops the following:

void loop () {

But I want to create an adjustable delay that I can put at any point along the run of the LED chase. For example Id like led's 0-18 to light up and fade out as normal, and then LED#19 wont start until 3 seconds later.

What Ive done is made an incrementFadesA() and incrementFadesB(), where A's loop goes from 0-17, and B's goes from 18-31.

Because the tlc5940 needs to be updated constantly, putting in a simple delay(300); wont work.

Ive been trying things like

void loop () {


      if (millis()>=1500) {

but only incrementFadesA(); will work.

Is there an independent timer or sequence I can run that wont affect the setGreys() or feedPorts(), so that I can run incrementFadesB() at a later time?



Pages: [1]   Go Up
Jump to: