Pages: [1]   Go Down
Author Topic: LED Matrix 5x7 first project is working , but ........  (Read 934 times)
0 Members and 1 Guest are viewing this topic.
Netherlands
Offline Offline
Jr. Member
**
Karma: 1
Posts: 53
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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:
/*
 * 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,




Thank's for reading this post !!!

Regards ,

ArduinoPat,
« Last Edit: September 23, 2012, 04:59:37 am by ArduinoPat » Logged

Patrick ,The Netherlands

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 634
Posts: 50243
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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:
        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:
if(pixel)
Logged

Pages: [1]   Go Up
Jump to: