Go Down

Topic: LED Matrix 5x7 first project is working , but ........ (Read 961 times) previous topic - next topic

ArduinoPat

Sep 23, 2012, 11:56 am Last Edit: Sep 23, 2012, 11:59 am by ArduinoPat Reason: 1
Hello All,

I have test my first ledmatrix well, but is it possible to scroll this text from the right to the left ??
Maby some one can help me on the right way for making this possible.

Find attached the sketch i use now:

Code: [Select]
/*
* matrixMpxAnimation sketch
* PD7X
*/


// a 0 indicates the LED is off, 1 is on

byte BigP[] = {
 B11110,
 B10001,
 B10001,
 B11110,
 B10000,
 B10000,
 B10000};

byte BigD[] = {
 B11110,
 B10001,
 B10001,
 B10001,
 B10001,
 B10001,
 B11110};


byte Big7[] = {
 B11111,
 B00001,
 B00010,
 B00100,
 B00100,
 B00100,
 B00100};

byte BigX[] = {
 B10001,
 B01010,
 B00100,
 B00100,
 B00100,
 B01010,
 B10001};
 
 
 
const int columnPins[] = {  6, 5, 4, 3, 2};
const int rowPins[]    = { 10,11,12,15,16,17,18};

void setup() {
 for (int i = 0; i < 8; i++)
 {
   pinMode(rowPins[i], OUTPUT);        // make all the LED pins outputs
   pinMode(columnPins[i], OUTPUT);
   digitalWrite(columnPins[i], HIGH);  // disconnect column pins from Ground
 }
}

void loop() {
 int pulseDelay =100 ;          // milliseconds to wait between beats

 show(BigP, 500);      // followed by the big Letter for 200ms
 show(BigD, 500);
 show(Big7, 500);
 show(BigX, 500);
 delay(pulseDelay);              // show nothing between beats
}

// routine to show a frame of an image stored in the array pointed to
// by the image parameter.
// the frame is repeated for the given duration in milliseconds
void show( byte * image, unsigned long duration)
{
unsigned long start = millis();            // begin timing the animation
while (start + duration > millis())        // loop until duration period has passed
 {
   for(int row = 0; row < 7; row++)
   {
     digitalWrite(rowPins[row], HIGH);          // connect row to +5 volts
     for(int column = 0; column < 5; column++)
     {
       boolean pixel = bitRead(image[row],column);
       if(pixel == 1)
       {
         digitalWrite(columnPins[column], LOW);  // connect column to Gnd
       }
       delayMicroseconds(300);                   // a small delay for each LED
       digitalWrite(columnPins[column], HIGH);   // disconnect column from Gnd
     }
     digitalWrite(rowPins[row], LOW);            // disconnect LEDs
   }
 }
}
     
   



Also find attached the Youtube Link,

http://www.youtube.com/watch?v=TjxOjevAqGY


Thank's for reading this post !!!

Regards ,

ArduinoPat,
Patrick ,The Netherlands

PaulS

Quote
but is it possible to scroll this text from the right to the left ??

When you can only show one letter at a time, how do you envision scrolling working? In my mind, a scrolling display show several letters, and each iteration moves the letters one position to the right or left.

Code: [Select]
        boolean pixel = bitRead(image[row],column);
        if(pixel == 1)

A boolean is intended to hold true or false. The if test should be simply:
Code: [Select]
if(pixel)

Go Up