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