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.
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()