Using Max 7221 with discrete Leds

Greetings fellow makers!

I'm new here and I've been away from tinkering for awhile, but recently pulled out my arduino uno and found two Max 7221 chips. A long time ago i was looking to use them to run leds for a clock design i had in mind. I want to be able to run 60 Leds for seconds, mins, and 12 Leds for hours. My question is whether it's possible to actually light up discrete Leds using these chips. I tried wiring up two Leds and connecting them across specific dig and seg outputs then cutting and pasting what seemed like the right bits of code to light them up. I got as far as being able to compile the code, but it didn't do anything. Has anyone actually tried doing this? If so, what code did you use to get the Leds to light? Here's the code I found and used that didn't work:

#include "LedControl.h"

LedControl lc1=LedControl(7,6,5,2);

void setup() {
lc1.shutdown(0,false);
lc1.setIntensity(0,8);
lc1.setLed(0,0,0,true);
lc1.setLed(0,1,1,true);
delay(1000);
lc1.setLed(0,0,0,false);
lc1.setLed(0,1,1,false);

}

void loop(){}

Yes, you can control individual LEDs. I've never used a library with mine.
You set up the control registers in setup, then write to the 8 data registers with the LED on/off data you want.

Here's a board I offer that lets one easily wire up to individual LEDs and a video of it working:
http://www.crossroadsfencing.com/BobuinoRev17/MAX7219demo_movie.AVI
http://www.crossroadsfencing.com/BobuinoRev17/

Wow I'm impressed with all your familiarity of microcontrollers. I just realized i also have the experimenters guide for the arduino i found. I'll review the use of the 74HC595 shift register. If that works I might just use that instead. But it just might help me reprogram the Max 7221 as well. This should keep me busy for a little while :slight_smile:

Thanks for the quick response!

Bryan

74HC595 is easy:

'595 SRCLR to +5
'595 OE/ to GND
'595 needs 0.1uF cap from Vcc to Gnd

Arduino SCK to SRCLK
Ardiuno MOSI to Serial Data in
Arduino Pin 10 to RCLK

Simple example:

#include <SPI.h>
byte ssPin = 10;
byte displatData1 = 0b10101010;
byte displatData2 = 0b01010101;

void setup(){
pinMode (ssPin, OUTPUT);
SPI.begin();
}

void loop(){
digitalWrite (ssPIN, LOW);
SPI.transfer (displayData1);
digitalWrite (ssPIN, HIGH); // data updated on this rising edge

delay (500);

digitalWrite (ssPIN, LOW);
SPI.transfer (displayData2);
digitalWrite (ssPIN, HIGH); // data updated on this rising edge

delay(500);

}