Expand description
Provides utility functions on top of “max7219”-crate to display data (like text) on a MAX7219 powered matrix display.
Modules§
- encoding
- Encoding utility functions that helps you to print symbols easily on a MAX7219-powered LED matrix.
- mappings
- Provides mappings for a mono spaced font I created myself. The font is not complete and many symbols are missing. This ist just an demonstration how it could be done.
Constants§
- LED_
SQUARE_ MATRIX_ DIM - We use 8x8 square matrices (per single display)
- MAX_
DISPLAYS - Maximum supported chained displays by MAX7219.
Functions§
- prepare_
display - Convenient function that turns on the display, clears the display and sets the brightness to the highest possible value. It also sets the DecodeMode to NoDecode which is necessary for displaying content on the 8x8 matrix display. (Max7219 can also be used for 7 segment displays).
- remove_
gaps_ in_ display_ text - Iterates through the data and removes all gaps between symbols. A gap is two or more cols after each other that are all zero. This way, text looks more natural, as letters are closer together. Hence, we do not have a monospace font here. But (currently), also spaces are removed.
- setup_
adapter - Set’s up the MAX7219-driver using “gpio_cdev”. This only works on Linux. It works for example on Raspberry. The communication uses SPI protocol. This does not require the “SPI Module” on Raspberry Pi to be activated. This works via regular GPIO pins.
- shift_
all_ rows_ one_ bit_ left - Shift all row bits one to the left (to the next col). This way you can animate a moving text.
- show_
moving_ text_ in_ loop - Shows a moving text in loop. After each iteration all bits are shifted one col to the left.
Make sure to call
prepare_display()
first! - transpose_
single_ display_ data - This does a transpose operation on the
SingleDisplayData
-Matrix and is a helper function forremove_gaps_in_display_text
. Cols become rows and rows become cols. Example:
Type Aliases§
- Max7219
Adapter - The type of the driver.