Hey everybody,
I've connected a MAX7219 dot matrix display to my arduino. What code do I need to just show custom icons, so not regular ASCII symbols. eventually I want to skip to 7 icons with a simpel pushbutton.
I've tried a lot of example sketches, but I cannot understand them enough to change them for my purpose.
Make yourself a chart like this, I used Excel, and translate your icon into 1s & 0s. You will then send these bytes to the MAX72319 to display.
Using HEX format makes it easy to keep the program size smaller.
Can also use binary format: 0b00000001 vs 0x01, 0b01000001 vs 0x41, etc.
Your code will periodically send data to the MAX7219 registers, which then get multiplexed onto the display.
To send the data, you can call this:
// do an update
for (x=1; x<9; x=x+1){
digitalWrite (ssPin, LOW);
SPI.transfer(x); // send data register address, 1 to 8
SPI.transfer (dataArray[x-1]); // arrays are indexed starting at 0
digitalWrite (ssPin, HIGH);
}
This will put 8 bytes of data into 8 data registers for display.
There 4 or 5 control registers, you will set them up with data the same way in setup() as they only need to run once. See Table 2 in the data sheet:
shutdown register - set to normal mode
no-decode mode - your data is used as is
lamp-test - can turn on & then off to make all LEDs flash once
intensity - sets brightness of the LEDs
scan limit - how many columns (digits) are being used - for an 8x8 matrix, set for 8