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
- 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, height, spi, cs, *, baudrate=8000000, polarity=0, phase=0)[source]¶ MAX2719 - driver for displays based on max719 chip_select
Parameters: - width (int) – the number of pixels wide
- height (int) – the number of pixels high
- spi (object) – an spi busio or spi bitbangio object
- chip_select (DigitalInOut) – digital in/out to use as chip select signal
- baudrate – for SPIDevice baudrate (default 8000000)
- polarity – for SPIDevice polarity (default 0)
- phase – for SPIDevice phase (default 0)
-
brightness
(value)[source]¶ Controls the brightness of the display.
Parameters: value (int) – 0->15 dimmest to brightest
-
fill
(bit_value)[source]¶ Fill the display buffer.
Parameters: bit_value (int) – value > 0 set the buffer bit, else clears the buffer bit
adafruit_max7219.matrices.Matrix8x8
¶
-
class
adafruit_max7219.matrices.
Matrix8x8
(spi, cs)[source]¶ Driver for a 8x8 LED matrix based on the MAX7219 chip.
Parameters: - spi (object) – an spi busio or spi bitbangio object
- cs (DigitalInOut) – digital in/out to use as chip select signal
adafruit_max7219.bcddigits.BCDDigits
¶
-
class
adafruit_max7219.bcddigits.
BCDDigits
(spi, cs, nDigits=1)[source]¶ Basic support for display on a 7-Segment BCD display controlled by a Max7219 chip using SPI.
Parameters: - spi (object) – 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