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);
}