i have been working on an 8x80 led matrix display. i have managed to get it to display text however i now want the text to be scrolling. any ideas on where i go from here with this code would be very much appreciated as i am completely stuck. Thanks.
int redData = 10;
int clockPin = 12; //clock
int latchPin = 11; //latch
int enablePin = 8;
//const int horizontalDisplay = 10;
//const int verticlaDisplay = 1;
byte data;
byte dataArray[8];
byte dataArray1[8];
byte dataArray2[8];
byte dataArray3[8];
byte dataArray4[8];
byte dataArray5[8];
byte dataArray6[8];
byte dataArray7[8];
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
dataArray[0] = 0xff;
dataArray[1] = 0xff;
dataArray[2] = 0xff;
dataArray[3] = 0xff; // O
dataArray[4] = 0xff;
dataArray[5] = 0xff;
dataArray[6] = 0xff;
dataArray[7] = 0xff;
//{0xff,0x81,0xbd,0xbd,0xbd,0xbd,0xbd,0x81}
dataArray1[0] = 0x81;
dataArray1[1] = 0xBD;
dataArray1[2] = 0xBD;
dataArray1[3] = 0xBD; // O
dataArray1[4] = 0xBD;
dataArray1[5] = 0xBD;
dataArray1[6] = 0x81;
dataArray1[7] = 0xFF;
//{0xff,0xbd,0xbd,0xbd,0x81,0xbd,0xbd,0xbd}
dataArray2[0] = 0xBD;
dataArray2[1] = 0xBD;
dataArray2[2] = 0xBD;
dataArray2[3] = 0x81;
dataArray2[4] = 0xBD; //H
dataArray2[5] = 0xBD;
dataArray2[6] = 0xBD;
dataArray2[7] = 0xFF;
//{0xff,0x81,0xbf,0xbf,0x81,0xbf,0xbf,0x81}
dataArray3[0] = 0x81;
dataArray3[1] = 0xBF;
dataArray3[2] = 0xBF;
dataArray3[3] = 0x81;
dataArray3[4] = 0xBF; //E
dataArray3[5] = 0xBF;
dataArray3[6] = 0x81;
dataArray3[7] = 0xFF;
//{0xbf,0xbf,0xbf,0xbf,0xbf,0xbf,0xbf,0x81}
dataArray4[0] = 0xBF;
dataArray4[1] = 0xBF;
dataArray4[2] = 0xBF;
dataArray4[3] = 0xBF;
dataArray4[4] = 0xBF; //L
dataArray4[5] = 0xBF;
dataArray4[6] = 0x81;
dataArray4[7] = 0xFF;
pinMode(enablePin, OUTPUT);
pinMode(clockPin, OUTPUT);
pinMode(redData, OUTPUT);
pinMode(latchPin, OUTPUT);
DDRC = DDRC | B11110000;
for (int i=0; i<8; i++){
PORTC = i<<4;
digitalWrite(enablePin, 0);
shiftOut(redData, clockPin, MSBFIRST, 0);
shiftOut(redData, clockPin, MSBFIRST, 0);
shiftOut(redData, clockPin, MSBFIRST, 0);
shiftOut(redData, clockPin, MSBFIRST, 0);
shiftOut(redData, clockPin, MSBFIRST, 0);
shiftOut(redData, clockPin, MSBFIRST, 0);
shiftOut(redData, clockPin, MSBFIRST, 0);
shiftOut(redData, clockPin, MSBFIRST, 0);
shiftOut(redData, clockPin, MSBFIRST, 0);
shiftOut(redData, clockPin, MSBFIRST, 0);
digitalWrite(enablePin, 1);
delay(1);
}
analogWrite(enablePin,255);
}
void loop() {
// put your main code here, to run repeatedly:
//for(int j=0; j<=7; j++) {
// digitalWrite(latchPin, LOW);
// digitalWrite(latchPin2, LOW);
for (int i=0; i<8; i++){
PORTC = i<<4;
digitalWrite(latchPin, LOW);
shiftOut(redData, clockPin, MSBFIRST, dataArray*);*
_ shiftOut(redData, clockPin, MSBFIRST, dataArray*);_
_ shiftOut(redData, clockPin, MSBFIRST, dataArray2);
shiftOut(redData, clockPin, MSBFIRST, dataArray3);
shiftOut(redData, clockPin, MSBFIRST, dataArray4);
shiftOut(redData, clockPin, MSBFIRST, dataArray4);
shiftOut(redData, clockPin, MSBFIRST, dataArray1);
shiftOut(redData, clockPin, MSBFIRST, dataArray);
shiftOut(redData, clockPin, MSBFIRST, dataArray);
shiftOut(redData, clockPin, MSBFIRST, dataArray);
digitalWrite(latchPin, HIGH);
delayMicroseconds(1);*_
}
}