[ASK] How t use Timer On DMD

The Dot Matrix Display (DMD) is a 32x16 array of high-brightness LEDs for visually striking effects. [Product Page]
Post Reply
galuhboy123
Posts:4
Joined:Thu Jun 19, 2014 1:05 am
[ASK] How t use Timer On DMD

Post by galuhboy123 » Fri Jun 20, 2014 1:15 am

I want make some code which can make some text become blinked . bud i want it with using timer . can anyone help me to show the code or example thank before :)

galuhboy123
Posts:4
Joined:Thu Jun 19, 2014 1:05 am

Re: [ASK] How t use Timer On DMD

Post by galuhboy123 » Fri Jun 20, 2014 1:16 am

NB: im using on Dotmatrix 32x16 thanks :)

angusgr
Freetronics Staff
Freetronics Staff
Posts:853
Joined:Tue Apr 09, 2013 11:19 pm
Location:Melbourne, Australia
Contact:

Re: [ASK] How t use Timer On DMD

Post by angusgr » Fri Jun 20, 2014 6:35 am

Hi galuhboy,

I'm currently working on the updated DMD2 library and I'll add a blinking text example to the list of examples I plan to write for the new library.

Unfortunately it may not be available for a little while.

- Angus

Brissieboy
Posts:209
Joined:Fri Sep 20, 2013 7:25 am

Re: [ASK] How t use Timer On DMD

Post by Brissieboy » Sat Jun 28, 2014 1:51 am

galuhboy,

You could try something simple like this while we wait for the new library:

Code: Select all

// include in your sketch before the "void setup()":
#define YOURDELAY 500; // set this to your flash rate in milliSeconds
#define DISPLAYOFF 0; 
unsigned int MillisLastTime = 0;
int DisplayState = 1; // holds current state of the display: 0 = OFF, otherwise ON

// include in your "void loop()" at the appropriate place:
  unsigned long MillisNow = millis(); // check the time now and remember it
  if(MillisNow - MillisLastTime > YOURDELAY) { // if it is time to change the display
    MillisLastTime = MillisNow; // remember when the display was changed
    if (DisplayState != DISPLAYOFF) // if the display is currently ON
       // clear your blinking message here
       DisplayState = DISPLAYOFF;
    else  // if the display is currently OFF
       // reprint your blinking message here
       DisplayState = 1;
    }

Post Reply