I just got my Arduino Mega 2560, MAX7219 and 8x8 LED dual color matrix. I tried connecting them up (only red colour led i.e. using only one MAX7219) based on the schematic diagram shown in Arduino Playground - MultiplexMAX72xx
I run a simple program that will switch on the red colour leds (i got it from a website):
#include "LedControl.h" // need the library
LedControl lc=LedControl(12,11,10,1); // lc is our object
// pin 12 is connected to the MAX7219 pin 1
// pin 11 is connected to the CLK pin 13
// pin 10 is connected to LOAD pin 12
// 1 as we are only using 1 MAX7219
void setup()
{
// the zero refers to the MAX7219 number, it is zero for 1 chip
lc.shutdown(0,false);// turn off power saving, enables display
lc.setIntensity(0,15);// sets brightness (0~15 possible values)
lc.clearDisplay(0);// clear screen
}
void loop()
{
for (int row=0; row<8; row++)
{
for (int col=0; col<8; col++)
{
lc.setLed(0,col,row,true); // turns on LED at col, row
delay(0.01);
//lc.setLed(0,col,row,false); // turns off LED at col, row
}
}
}
The Leds are flickering! Is there any ways to eliminate it or did I make any mistake?
Another issue is I tried to set the intensity of the LEDs (to max i.e. 15), but it still looks rather dim to me. Any ways to increase the intensity? I used a resistor of 27K ohms in the circuit.
First off modify that post so the code is in a box. Select the code and hit the #icon then save.
It looks like you are constantly writing to the LEDs and that is asynchronously to the scan.
To see if this is the case stick a 2 second delay at the end of your loop.
I would like to know if a delay of 2 sec is written as "delay(2000)" or "delay(2)". I tends to saw some codes wrote "4" and the arduino's langauge reference shows it is in terms of milliseconds.
Each row lights up at a time at a very fast rate. this performance continues after a short period of time (probably less than 1.5 mins) and all LEDs switch off.
adding on to the previous post, the lights are lik fading off sometimes and it will become bright again... I upload the code second time and the leds do not switch off anymore.