Tuesday, 13 April 2010

Changing number of frames in scrolling text

the following video shows how I have changed the frame rate. A frame is set as a 8*8 array. Initially this was set to 8 as reflected in the code I posted previously. Here are the alterations i made;

byte bitmaps[10][8][8];     // Space for 10 frames of 8x8 pixels
was changed to;
byte bitmaps[12][8][8];     // Space for 12 frames of 8x8 pixels


currentBitmap = 8;
  targetBitmap = 8;
  lastTime = millis();
was changed to; currentBitmap = 12;
  targetBitmap = 12;
  lastTime = millis();


targetBitmap%=8;  // there are 8 frames, from 0 to 7
was changed to;
targetBitmap%=12;  // there are 12frames, from 0 to11


void drawFrame(byte frame[8][8])
was changed to;
void drawFrame(byte frame[12][8])

I also clearly added more arrays (12 in total). They are so easy to work with. As you can see, you simply draw your text or symbol by changing the digits in the array, as a single 8*8 Led Matrix frame is accurately represented by each array. 







No comments:

Post a Comment