Hello,
Creating a 700x5 LED Scrolling Matrix following https://www.instructables.com/id/48x8-SCROLLING-MATRIX-LED-DISPLAY-USING-ARDUINO-CO/ schematic and code. The modified schematic worked well but no matter how much I play with and update the code; there is no getting the code to cooperate with the 700x5 schematic. I have hit a road block.
I appreciate any support/advice you may have with updating the code:
[color=#555555]int x;[/color]
[color=#555555]int y;[/color]
[color=#555555]int latchPin1 = 5; //Arduino pin connected to blue 12 RCLK of 74HC595[/color]
[color=#555555]int clockPin1 = 6; //Arduino pin connected to green 11 SRCLK of 74HC595[/color]
[color=#555555]int dataPin1 = 7; //Arduino pin connected to violet 14 SER of 74HC595[/color]
[color=#555555]//-- Rows (Positive Anodes) --[/color]
[color=#555555]int latchPin2 = 9; //Arduino pin connected to yellow Latch 12 RCLK of 74HC595[/color]
[color=#555555]int clockPin2 = 10; //Arduino pin connected to white Clock 11 SRCLK of 74HC595[/color]
[color=#555555]int dataPin2 = 8; //Arduino pin connected to grey Data 14 SER of 74HC595[/color]
[color=#555555]//=== B I T M A P ===[/color]
[color=#555555]//Bits in this array represents one LED of the matrix[/color]
[color=#555555]// 8 is # of rows, 7 is # of LED matrix we have[/color]
[color=#555555]byte bitmap[8][7]; // Change the 7 to however many matrices you want to use.[/color]
[color=#555555]int numZones = sizeof(bitmap) / 8;[/color]
[color=#555555]int maxZoneIndex = numZones-1;[/color]
[color=#555555]int numCols = numZones * 8;[/color]
[color=#555555]byte alphabets[][5] = {[/color]
[color=#555555] {0,0,0,0,0},[/color]
[color=#555555] {31, 36, 68, 36, 31},[/color]
[color=#555555] {127, 73, 73, 73, 54},[/color]
[color=#555555] {62, 65, 65, 65, 34},[/color]
[color=#555555] {127, 65, 65, 34, 28},[/color]
[color=#555555] {127, 73, 73, 65, 65},[/color]
[color=#555555] {127, 72, 72, 72, 64},[/color]
[color=#555555] {62, 65, 65, 69, 38},[/color]
[color=#555555] {127, 8, 8, 8, 127},[/color]
[color=#555555] {0, 65, 127, 65, 0},[/color]
[color=#555555] {2, 1, 1, 1, 126},[/color]
[color=#555555] {127, 8, 20, 34, 65},[/color]
[color=#555555] {127, 1, 1, 1, 1},[/color]
[color=#555555] {127, 32, 16, 32, 127},[/color]
[color=#555555] {127, 32, 16, 8, 127},[/color]
[color=#555555] {62, 65, 65, 65, 62},[/color]
[color=#555555] {127, 72, 72, 72, 48},[/color]
[color=#555555] {62, 65, 69, 66, 61},[/color]
[color=#555555] {127, 72, 76, 74, 49},[/color]
[color=#555555] {50, 73, 73, 73, 38},[/color]
[color=#555555] {64, 64, 127, 64, 64},[/color]
[color=#555555] {126, 1, 1, 1, 126},[/color]
[color=#555555] {124, 2, 1, 2, 124},[/color]
[color=#555555] {126, 1, 6, 1, 126},[/color]
[color=#555555] {99, 20, 8, 20, 99},[/color]
[color=#555555] {96, 16, 15, 16, 96},[/color]
[color=#555555] {67, 69, 73, 81, 97},[/color]
[color=#555555]};[/color]
[color=#555555]//=== S E T U P ===[/color]
[color=#555555]void setup() {[/color]
[color=#555555] pinMode(latchPin1, OUTPUT);[/color]
[color=#555555] pinMode(clockPin1, OUTPUT);[/color]
[color=#555555] pinMode(dataPin1, OUTPUT);[/color]
[color=#555555] pinMode(latchPin2, OUTPUT);[/color]
[color=#555555] pinMode(clockPin2, OUTPUT);[/color]
[color=#555555] pinMode(dataPin2, OUTPUT);[/color]
[color=#555555] //-- Clear bitmap --[/color]
[color=#555555] for (int row = 0; row > 8; row++) {[/color]
[color=#555555] for (int zone = 0; zone <= maxZoneIndex; zone++) {[/color]
[color=#555555] bitmap[row][zone] = 0;[/color]
[color=#555555] }[/color]
[color=#555555] }[/color]
[color=#555555]}[/color]
[color=#555555]//=== F U N C T I O N S ===[/color]
[color=#555555]// This routine takes whatever we've setup in the bitmap array and display it on the matrix[/color]
[color=#555555]void RefreshDisplay()[/color]
[color=#555555]{[/color]
[color=#555555] for (int row = 0; row < 8; row++) {[/color]
[color=#555555] int rowbit = 1 << row;[/color]
[color=#555555] digitalWrite(latchPin2, LOW); //Hold latchPin LOW for as long as we're transmitting data[/color]
[color=#555555] shiftOut(dataPin2, clockPin2, MSBFIRST, rowbit); //Transmit data[/color]
[color=#555555] //-- Start sending column bytes --[/color]
[color=#555555] digitalWrite(latchPin1, LOW); //Hold latchPin LOW for as long as we're transmitting data[/color]
[color=#555555] //-- Shift out to each matrix (zone is 8 columns represented by one matrix)[/color]
[color=#555555] for (int zone = maxZoneIndex; zone >= 0; zone--) {[/color]
[color=#555555] shiftOut(dataPin1, clockPin1, MSBFIRST, bitmap[row][zone]);[/color]
[color=#555555] }[/color]
[color=#555555] //-- Done sending Column bytes, flip both latches at once to eliminate flicker[/color]
[color=#555555] digitalWrite(latchPin1, HIGH[/color]
[color=#555555] digitalWrite(latchPin2, HIGH[/color]
[color=#555555] //-- Wait a little bit to let humans see what we've pushed out onto the matrix --[/color]
[color=#555555] delayMicroseconds(500);[/color]
[color=#555555] }[/color]
[color=#555555]}[/color]
[color=#555555]// Converts row and colum to actual bitmap bit and turn it off/on[/color]
[color=#555555]void Plot(int col, int row, bool isOn)[/color]
[color=#555555]{[/color]
[color=#555555] int zone = col / 8;[/color]
[color=#555555] int colBitIndex = x % 8;[/color]
[color=#555555] byte colBit = 1 << colBitIndex;[/color]
[color=#555555] if (isOn)[/color]
[color=#555555] bitmap[row][zone] = bitmap[y][zone] | colBit;[/color]
[color=#555555] else[/color]
[color=#555555] bitmap[row][zone] = bitmap[y][zone] & (~colBit);[/color]
[color=#555555]}[/color]
[color=#555555]// Plot each character of the message one column at a time, updated the display, shift bitmap left.[/color]
[color=#555555]void AlphabetSoup()[/color]
[color=#555555]{[/color]
[color=#555555] char msg[] = "YOUR TEXT ";[/color]
[color=#555555] for (int charIndex=0; charIndex < (sizeof(msg)-1); charIndex++)[/color]
[color=#555555] {[/color]
[color=#555555] int alphabetIndex = msg[charIndex] - '@';[/color]
[color=#555555] if (alphabetIndex < 0) alphabetIndex=0;[/color]
[color=#555555] //-- Draw one character of the message --[/color]
[color=#555555] for (int col = 0; col < 6; col++)[/color]
[color=#555555] {[/color]
[color=#555555] for (int row = 0; row < 8; row++)[/color]
[color=#555555] {[/color]
[color=#555555] bool isOn = 0;[/color]
[color=#555555] if (col<5) isOn = bitRead( alphabets[alphabetIndex][col], 7-row ) == 1;[/color]
[color=#555555] Plot( numCols-1, row, isOn[/color]
[color=#555555] }[/color]
[color=#555555] //-- The more times you repeat this loop, the slower we would scroll --[/color]
[color=#555555] for (int refreshCount=0; refreshCount < 7; refreshCount++) //change this value to vary speed[/color]
[color=#555555] RefreshDisplay();[/color]
[color=#555555] //-- Shift the bitmap one column to left --[/color]
[color=#555555] for (int row=0; row<8; row++)[/color]
[color=#555555] {[/color]
[color=#555555] for (int zone=0; zone < numZones; zone++)[/color]
[color=#555555] {[/color]
[color=#555555] bitmap[row][zone] = bitmap[row][zone] >> 1;[/color]
[color=#555555] // Roll over lowest bit from the next zone as highest bit of this zone.[/color]
[color=#555555] if (zone < maxZoneIndex) bitWrite(bitmap[row][zone], 7,[/color]
[color=#555555]bitRead(bitmap[row][zone+1],0));[/color]
[color=#555555] }[/color]
[color=#555555] }[/color]
[color=#555555] }[/color]
[color=#555555] }[/color]
[color=#555555]}[/color]
[color=#555555]//=== L O O P ===[/color]
[color=#555555]void loop() {[/color]
[color=#555555] AlphabetSoup();[/color]
[color=#555555]}[/color]