MAX72XX code samples?

Does anyone have a code sample for working with the MAX72XX chips to run an LED array? There are multiple libraries for Arduino so I’ve been adapting code from there but my shaky grasp of Squirrel and sending the right bytes is proving difficult.

`hardware.spi189.configure(SIMPLEX_TX, 10000);

function send(data) {
hardware.pin7.write(0);
hardware.spi189.write(data);
hardware.pin7.write(1);
}
function configure() {
//send("\x0C\x00"); // shutdown on
//send("\x0F\x01"); // display_test on
send("\x0F\x00"); // display_test normal
send("\x09\x00"); // decode mode
send("\x0A\x0F"); // intensity
send("\x0B\x07"); // scanlimit
send("\x0C\x01"); // shutdown normal
}
configure();
//send("\x01\x03"); // this byte sequence to turn on the second digit and 2 segments is wrong
`

I can turn the display test on and off correctly but can’t toggle specific LEDs.
Any help would be appreciated!
-Jeff

Your code looks right, but are you doing level shifting to drive this display? The spec for the 72xx says minimum 3.5v to register a logic 1. It may work, but you are out of spec.

What do you have connected to the chip, exactly?

Thanks Hugo.
Right now I’m using Vin from the USB at 5v to drive the 72xx.

Connected to the chip is a 4 digit 7-segment display. I checked the spec and limited the current for the Rset of the 72xx accordingly.

Got it going and put my code in a gist: https://gist.github.com/feesta/5770518

My main problem was I was trying to figure out the bytes for setting segments with a 4 digit display with the anodes and cathodes of the LEDs switched from how the 72xx chip powers them. I wired it with digits to segments and segments to digits but this made turning on LEDs very confusing. I swapped out another display and it worked quickly using the Code B font from the 72xx.

I also had a case of do what I mean, not what I say with blob.written() rather than blob.writen()