max7219 lights on startup, but can't be controlled

As per the title.. all LEDs light up on bootup (assume this is an automatic procedure by the max7219)

but after a couple seconds the lights switch off and I can't program them to come back on...

I've tried using LEDControl library and Matrix library.. both the same outcome. I am new to both though so it is entirely probably that it's my programming fault.. The pins are definitely correct at least on the hardware... the code too as far as i am aware unless ive made a foolish oversight ;D

here's the Matrix lib code

#include "Binary.h"
#include "Sprite.h"
#include "Matrix.h"

Matrix myMatrix = Matrix(2, 0, 1);

void setup()
{

}

void loop()
{
  
  myMatrix.clear();
  
  delay(1000);

  // turn some pixels on
  myMatrix.write(1, 1, HIGH);
  myMatrix.write(1, 2, HIGH);
  myMatrix.write(1, 3, HIGH);
  myMatrix.write(1, 4, HIGH);
  
  delay(1000);
  
  myMatrix.write(1, 1, LOW);
  myMatrix.write(1, 2, LOW);
  myMatrix.write(1, 3, LOW);
  myMatrix.write(1, 4, LOW);
  
  delay(1000);
  myMatrix.write(2, 1, HIGH);
  myMatrix.write(2, 2, HIGH);
  myMatrix.write(2, 3, HIGH);
  myMatrix.write(2, 4, HIGH);
  
  delay(1000);
  
  myMatrix.write(2, 1, LOW);
  myMatrix.write(2, 2, LOW);
  myMatrix.write(2, 3, LOW);
  myMatrix.write(2, 4, LOW);
  
  delay(1000);
  myMatrix.write(3, 1, HIGH);
  myMatrix.write(3, 2, HIGH);
  myMatrix.write(3, 3, HIGH);
  myMatrix.write(3, 4, HIGH);
  
  delay(1000);
  
  myMatrix.write(3, 1, LOW);
  myMatrix.write(3, 2, LOW);
  myMatrix.write(3, 3, LOW);
  myMatrix.write(3, 4, LOW);
  
  delay(1000);
  
  myMatrix.write(4, 1, HIGH);
  myMatrix.write(4, 2, HIGH);
  myMatrix.write(4, 3, HIGH);
  myMatrix.write(4, 4, HIGH);
  
  delay(1000);
  
  myMatrix.write(4, 1, LOW);
  myMatrix.write(4, 2, LOW);
  myMatrix.write(4, 3, LOW);
  myMatrix.write(4, 4, LOW);
  
  delay(1000);      
  myMatrix.write(1,1, LOW);
 
}

here's the LEDControl lib code:

#include "LedControl.h"

#undef int
#undef abs
#undef double
#undef float
#undef round

LedControl lc1 = LedControl(2, 0, 1, 1);



void setup()
{
  lc1.shutdown(0,false);
  lc1.setIntensity(0, 5);
  lc1.clearDisplay(0);
  


}

void loop()
{
/*
  //switch on the led in the 3'rd row 8'th column
//and remember that indices start at 0! 
lc1.setLed(0,2,7,true);   
//Led at row 0 second from left too
lc1.setLed(0,0,1,true);   
delay(500);
//switch the first Led off (second one stays on)
lc1.setLed(0,2,7,false); 
 
  lc1.setLed(0, 1, 1, true);
  delay (500);
  lc1.setLed(0, 1, 1, false);
  delay (500);
  */
  lc1.setRow(0, 0, B01111110);
  delay(200);
  lc1.setRow(0, 0, B10010110);
  delay(200);
  
}

Hi,
this effect was reported a few times by other users and in all cases there was problem with the wiring of the Led-Matrix.

The wiring must follow the schematic in this article:
http://www.arduino.cc/playground/Main/MAX72XXHardware#WiringLedMatrix
If only one of the Leds is wired the wrong way round this can lead to the effect you are seeing.

Another reason for the problem might your use of pins 0 and 1 for talking to the MAX7219. The Arduino board/IDE uses these pins to upload new code through the bootloader.

It is generaly a bad idea to use these Arduino pins for any purpose than Serial communication.

Change your wiring (and the code) to use any other pins than 0 and 1 and see if that works.

Eberhard

Thanks.. the LEDs seem to be the right way around, I'll try different pins

OOOOOKaaay... thanks!

vaguely getting there.. switched to 5,6,7 instead of 0,1,2

now I'm getting no lightup at the beginning and almost instantaneous flashes instead of one second long bursts.. ::slight_smile:

even stranger.. if I pull the jumper pins out of the arduino (for DIN/LOAD/CLK) and scrub them with my finger, I get a response from the lights.. so I have no freaking idea what the problem is now

YAY :smiley: working..

well except my LED array is arranged:

2,3,4,1
2,3,4,1
2,3,4,1
2,3,4,1

nevermind though that's not hard to fix :smiley:

So what was the fix?
I am using the 7221, SPI interface, to control 8 seven-segment displays & decimal points.
I just followed its datasheet to set up the control registers prior to writing data to it. No problems.

Not sure in the end.. I moved from using 5/6/7 to using 19/18/17 instead and all I know is that it works fine now haha.

Hi everyone, I have the same problem, the led still goes on, but also with one led test...