Hello kind people,
I have been a silent lurker for a a while and have by and large been able to resolve my issues with the resolutions posted by the experienced folks here. However I have run into an issue that I am unable to resolve. My idea is to build a 16x64 audio spectrum analyzer. I have the code working for an 8x64 matrix, but my problem is that when using a 16x64 matrix things go crazy. Below is a code snippet that i use to test the matrix:
#include <SPI.h>
#include <Adafruit_GFX.h>
#include <Max72xxPanel.h>
int pinCS = 10; // Attach CS to this pin, DIN to MOSI and CLK to SCK (cf http://arduino.cc/en/Reference/SPI )
int numberOfHorizontalDisplays = 8;
int numberOfVerticalDisplays = 1;
Max72xxPanel matrix = Max72xxPanel(pinCS, numberOfHorizontalDisplays, numberOfVerticalDisplays);
void setup() {
matrix.setIntensity(15);
// Adjust to your own needs
matrix.setPosition(0, 0, 1); // The first display is at <0, 0>
matrix.setPosition(1, 1, 1); // The second display is at <1, 0>
matrix.setPosition(2, 2, 1); // The third display is at <2, 0>
matrix.setPosition(3, 3, 1); // And the last display is at <3, 0>
matrix.setPosition(4, 4, 1); // And the last display is at <3, 0>
matrix.setPosition(5, 5, 1); // And the last display is at <3, 0>
matrix.setPosition(6, 6, 1); // And the last display is at <3, 0>
matrix.setPosition(7, 7, 1); // And the last display is at <3, 0>
matrix.setPosition(8, 0, 0); // The first display is at <0, 0>
matrix.setPosition(9, 1, 0); // The second display is at <1, 0>
matrix.setPosition(10, 2, 0); // The third display is at <2, 0>
matrix.setPosition(11, 3, 0); // And the last display is at <3, 0>
matrix.setPosition(12, 4, 0); // And the last display is at <3, 0>
matrix.setPosition(13, 5, 0); // And the last display is at <3, 0>
matrix.setPosition(14, 6, 0); // And the last display is at <3, 0>
matrix.setPosition(15, 7, 0); // And the last display is at <3, 0>
// ...
matrix.setRotation(0, 1); // The first display is position upside down
matrix.setRotation(1, 1);
matrix.setRotation(2, 1);
matrix.setRotation(3, 1); // The same hold for the last display
matrix.setRotation(4, 1);
matrix.setRotation(5, 1);
matrix.setRotation(6, 1);
matrix.setRotation(7, 1);
matrix.setRotation(8, 1); // The first display is position upside down
matrix.setRotation(9, 1);
matrix.setRotation(10, 1);
matrix.setRotation(11, 1); // The same hold for the last display
matrix.setRotation(12, 1);
matrix.setRotation(13, 1);
matrix.setRotation(14, 1);
matrix.setRotation(15, 1);
}
void loop() {
// put your main code here, to run repeatedly
matrix.fillScreen(LOW);
for (int x = 0; x<matrix.width(); x++){
//int temp = amplitude[x];
for(int y = 0; y<=16;y++){
matrix.drawLine(x, 16, x, 16 - y, HIGH);
matrix.write(); // Send bitmap to display
delay(10);
}
}
}
My basic issue is that the arduino-Max72xxPanel seems to refuse to work after 10 modules. I am happy to edit the library source. However I am have no clue where to begin. Can some one one please point me in the correct direction? Appreciate the help.
Thanks
Nitin