adafruit_max7219.max7219
- MAX7219 LED Matrix/Digit Display Driver¶
CircuitPython library to support MAX7219 LED Matrix/Digit Display Driver. This library supports the use of the MAX7219-based display in CircuitPython, either an 8x8 matrix or a 8 digit 7-segment numeric display.
See Also¶
matrices.Maxtrix8x8 is a class support an 8x8 led matrix display
matrices.CustomMatrix is a class support a custom sized constellation of 8x8 led matrix displays
bcddigits.BCDDigits is a class that support the 8 digit 7-segment display
Beware that most CircuitPython compatible hardware are 3.3v logic level! Make sure that the input pin is 5v tolerant.
Author(s): Michael McWethy
Implementation Notes¶
Hardware:
Adafruit MAX7219CNG LED Matrix/Digit Display Driver - MAX7219 (Product ID: 453)
Software and Dependencies:
Adafruit CircuitPython firmware for the ESP8622 and M0-based boards: https://github.com/adafruit/circuitpython/releases
Adafruit’s Bus Device library: https://github.com/adafruit/Adafruit_CircuitPython_BusDevice
Notes: #. Datasheet: https://cdn-shop.adafruit.com/datasheets/MAX7219.pdf
- class adafruit_max7219.max7219.MAX7219(width: int, height: int, spi: SPI, cs: DigitalInOut, *, baudrate: int = 8000000, polarity: int = 0, phase: int = 0)[source]¶
Bases:
object
MAX7219 - driver for displays based on max7219 chip_select
- Parameters
width (int) – the number of pixels wide
height (int) – the number of pixels high
spi (SPI) – an spi busio or spi bitbangio object
chip_select (DigitalInOut) – digital in/out to use as chip select signal
baudrate (int) – for SPIDevice baudrate (default 8000000)
polarity (int) – for SPIDevice polarity (default 0)
phase (int) – for SPIDevice phase (default 0)
- brightness(value: int) None [source]¶
Controls the brightness of the display.
- Parameters
value (int) – 0->15 dimmest to brightest
- fill(bit_value: int) None [source]¶
Fill the display buffer.
- Parameters
bit_value (int) – value > 0 set the buffer bit, else clears the buffer bit
- class adafruit_max7219.max7219.ChainableMAX7219(width: int, height: int, spi: SPI, cs: DigitalInOut, *, baudrate: int = 8000000, polarity: int = 0, phase: int = 0)[source]¶
Bases:
MAX7219
Daisy Chainable MAX7219 - driver for cascading displays based on max7219 chip_select
- Parameters
width (int) – the number of pixels wide
height (int) – the number of pixels high
spi (SPI) – an spi busio or spi bitbangio object
chip_select (DigitalInOut) – digital in/out to use as chip select signal
baudrate (int) – for SPIDevice baudrate (default 8000000)
polarity (int) – for SPIDevice polarity (default 0)
phase (int) – for SPIDevice phase (default 0)
adafruit_max7219.matrices
¶
- class adafruit_max7219.matrices.Matrix8x8(spi: SPI, cs: DigitalInOut)[source]¶
Driver for a 8x8 LED matrix based on the MAX7219 chip.
- Parameters
spi (SPI) – an spi busio or spi bitbangio object
cs (DigitalInOut) – digital in/out to use as chip select signal
- class adafruit_max7219.matrices.CustomMatrix(spi: SPI, cs: DigitalInOut, width: int, height: int, *, rotation: int = 1)[source]¶
Driver for a custom 8x8 LED matrix constellation based on daisy chained MAX7219 chips.
- Parameters
spi (SPI) – an spi busio or spi bitbangio object
cs (DigitalInOut) – digital in/out to use as chip select signal
width (int) – the number of pixels wide
height (int) – the number of pixels high
rotation (int) – the number of times to rotate the coordinate system (default 1)
- rect(x: int, y: int, width: int, height: int, color: int, fill: bool = False) None [source]¶
Draw a rectangle at the given position of the given size, color, and fill.
adafruit_max7219.bcddigits.BCDDigits
¶
- class adafruit_max7219.bcddigits.BCDDigits(spi: SPI, cs: DigitalInOut, nDigits: int = 1)[source]¶
Basic support for display on a 7-Segment BCD display controlled by a Max7219 chip using SPI.
- Parameters
spi (SPI) – an spi busio or spi bitbangio object
cs (DigitalInOut) – digital in/out to use as chip select signal
nDigits (int) – number of led 7-segment digits; default 1; max 8