Stand alone, was as follows: (2) 9v batteries in parallel fed into the 2.1mm Jack on an Arduino Uno, Pin12->DIN, Pin11->CLK, Pin10->Load, Pin7->1k Pull-up & Latching SW to GND. Reset Pins untouched, we were pressing the reset button on the uno.
With the RSET on the Max7219, we tried both a 10k and a 22k ohm resistor. Both worked, same problem.
//We always have to include the library
#include "LedControl.h"
/*
Now we need a LedControl to work with.
***** These pin numbers will probably not work with your hardware *****
pin 12 is connected to the DataIn
pin 11 is connected to the CLK
pin 10 is connected to LOAD
We have only a single MAX72XX.
*/
LedControl lc=LedControl(12,11,10,1);
int varMega = 0;
int varMicro = 0;
int iLoop = 0;
/* we always wait a bit between updates of the display */
unsigned long delaytime=125;
void setup() {
delay(500);
Serial.begin(9600);
pinMode(7, INPUT);
/*
The MAX72XX is in power-saving mode on startup,
we have to do a wakeup call
*/
lc.shutdown(0,false);
/* Set the brightness to a medium values */
lc.setIntensity(0,15);
/* and clear the display */
lc.clearDisplay(0);
lc.setScanLimit(0,5);
}
void loop()
{
for (int x = iLoop; x < 999; x++)
{
if(digitalRead(7) == LOW)
{
break;
}
setMega(x);
setMicro(random(0,999));
delay(50);
if (random(0,400) < 20){
delay(1000);
}
iLoop = x;
if (iLoop == 998)
{
iLoop = 0;}
}
}
void setFull(long num)
{
int digit1 = num / 100000;
long newNum = num - (digit1 * 100000);
int digit2 = newNum / 10000;
newNum = newNum - (digit2 * 10000);
int digit3 = newNum / 1000;
newNum = newNum - (digit3 * 1000);
int digit4 = newNum / 100;
newNum = newNum - (digit4 * 100);
int digit5 = newNum / 10;
newNum = newNum - (digit5 * 10);
int digit6 = newNum;
// int digit3 = (num - (digit1 * 100)) - (digit2 * 10);
lc.setDigit(0,0,digit1,false);
lc.setDigit(0,1,digit2,false);
lc.setDigit(0,2,digit3,true);
lc.setDigit(0,3,digit4,false);
lc.setDigit(0,4,digit5,false);
lc.setDigit(0,5,digit6,false);
}
void setMega(int num)
{
int digit1 = num / 100;
int digit2 = (num - (digit1 * 100))/10;
int digit3 = (num - (digit1 * 100)) - (digit2 * 10);
lc.setDigit(0,0,digit1,false);
lc.setDigit(0,1,digit2,false);
lc.setDigit(0,2,digit3,true);
}
void setMicro(int num)
{
int digit1 = num / 100;
int digit2 = (num - (digit1 * 100))/10;
int digit3 = (num - (digit1 * 100)) - (digit2 * 10);
lc.setDigit(0,3,digit1,false);
lc.setDigit(0,4,digit2,false);
lc.setDigit(0,5,digit3,false);
}