Let's stop for a minute:
Try using SPI, see code for wiring:
#include <SPI.h>
/*
Arduino MAX7219
SS 10 LOAD 12
MOSI 11 DIN 1
MISO 12 No Connection
SCK 13 CLK 13
*/
const byte MAX7219_REG_NOOP = 0x0;
const byte MAX7219_REG_DECODEMODE = 0x9;
const byte MAX7219_REG_INTENSITY = 0xA;
const byte MAX7219_REG_SCANLIMIT = 0xB;
const byte MAX7219_REG_SHUTDOWN = 0xC;
const byte MAX7219_REG_DISPLAYTEST = 0xF;
void sendByte (const byte reg, const byte data)
{
digitalWrite (SS, LOW); //
SPI.transfer (reg);
SPI.transfer (data);
digitalWrite (SS, HIGH);
}
void setup ()
{
SPI.begin ();
//sendByte (MAX7219_REG_SCANLIMIT, ?); //? = number of digits, i.e. 1-8
sendByte (MAX7219_REG_SCANLIMIT, 0); // show 1 digits (zero relative i.e. 0=1 . . . 7=8)
sendByte (MAX7219_REG_DECODEMODE, 0xFF); // use digits (not bit patterns)
sendByte (MAX7219_REG_DISPLAYTEST, 0); // no display test
sendByte (MAX7219_REG_INTENSITY, 7); // character intensity: range: 0 to 15
sendByte (MAX7219_REG_SHUTDOWN, 1); // not in shutdown mode (ie. start it up)
}
void loop ()
{
for (byte x = 0; x < 10; x++)
{
sendByte (0x1, x );
delay(500);
}
} // END of loop()
EDIT: updated sketch.