Hi everybody,
I have an array of 5 8x8 LED matrixes. They are each controlled by a MAX7221 chip. I have had this bank of matrixes working perfectly well and even got them hooked up to a BT controller so that I could change the sequence via a tablet. All working until today. I changed the Arduino Uno for a new one because I was having a small problem and wanted to eliminate any issues with the board. Since doing that (as far as I can tell) the matrixes are now behaving totally erratically. I have been able to get them working consistently for a bit when I desoldered one of my connections but then they went again. I have checked my connections thoroughly and made sure the contact all appears to be good but they are still not responding correctly.
I have now disconnected the other boards so that only 1 is connected. Below is the code I am uploading but when I upload it, the entire matrix lights. I have also tried adding flash delays which it also ignores.
I have also uploaded a quick video showing how the matrix responds and how it is wired: Video
#include "LedControl.h"
#include <binary.h>
int DIN = 10; // This is the PIN that the DATA IN is set to on the Arduino
int LOADCS = 11; // This is the PIN that the LOAD or CS is set to on the Arduino
int CLK = 12; // This is the PIN that the CLOCK is set to on the Arduino
int FlashDelay = 1000; // This is the delay in MS, 1000 = 1 second
int LEDBrightness = 15; // This is the brightness that the LEDs will be, 0-15, 0 = dimmest, 15 = brightest
//This is referencing the PINs above and loading them for the LED control.
//If you have more than one MAX chip then change the number after LOADCS from 1 to however many chips you have
LedControl lc=LedControl(DIN,CLK,LOADCS,5);
void setup()
{
lc.shutdown(0,false);
lc.setIntensity(0,LEDBrightness);
for(int index=0;index<lc.getDeviceCount();index++) {
lc.shutdown(index,false);
}
}
void loop()
{
lc.setColumn(0,0,B11111111);
lc.setColumn(0,1,B11111111);
lc.setColumn(0,2,B11111111);
lc.setColumn(0,3,B00000000);
lc.setColumn(0,4,B00000000);
lc.setColumn(0,5,B11111111);
lc.setColumn(0,6,B11111111);
lc.setColumn(0,7,B11111111);
}
Hi Paul, thanks for the reply. Yes, that was my thought and I did try that out in the video but it still didn't get the code working. It is strange as I have tried 3 of the boards, each with different results, none good. One lights the LEDs as in the video but does not respond to the code, the other 2 produce flickering, dim LEDs with only half the matrix lit. There seems to possibly be a connection issue with possibly the CLK cable but I can't see how to make the connection better or why it is happening all of a sudden.
Hi,
Thanks very much for your response. I have uploaded that code and all of the LEDs light and stay on, which is better than what happens when I run my code but still not right. I will try and post another video showing some continuity checks etc.
Yes, I have tried both Unos and they provide the same result (although it can be unpredictable). It seems to have happened since I plugged the new Uno in. Is there any way that the new Uno could have done something to the chips or boards?
Thanks for the suggestion, I will try that Ebay unit out.
I have already plugged directly into the second and third unit, disconnecting power from the rest to totally isolate the board and I have inconstant results on each board. I have even tried installing the Arduino software and LED library on another Mac and uploaded the code, just in case something was happening there but still no joy.
I have eliminated just about everything I can think of apart from the chips and board itself. I might try ordering a new MAX chip and replacing it, just to eliminate that but I feel like I am clutching at straws.
Just as a side note which might be relevant, the original problem I was having (hence trying a different Arduino) was that the first matrix would light full brightness and the others would be dim. The strange thing was that if I copied the code into a new script and uploaded it, sometimes the problem would be fixed. Also the matrixes would all light at full brightness when the board was initially plugged in, so I knew the LEDs and boards were probably ok.
Without that setIntensity() getting called for each of your matrixes (instead of only the first), maybe the brightness was ramdom for the other two, and different each time you reset the arduino?
Hi,
Just to update you, I plugged in the pre made unit from Ebay and the code worked fine. I tried some variations, all of which worked properly. So I know that everything is fine up until my boards. I am not sure what has happened to them but they appear to be fried.
In anticipation, I have already ordered an entirely new kit that will actually give me more functionality anyway as the code is pre made.