Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pdwerryhouse/max7219_8digit
Micropython driver for the max7219 with 8 x 7segment display
https://github.com/pdwerryhouse/max7219_8digit
Last synced: about 15 hours ago
JSON representation
Micropython driver for the max7219 with 8 x 7segment display
- Host: GitHub
- URL: https://github.com/pdwerryhouse/max7219_8digit
- Owner: pdwerryhouse
- License: gpl-3.0
- Created: 2017-03-19T11:14:30.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2023-03-18T23:27:06.000Z (over 1 year ago)
- Last Synced: 2024-08-02T20:45:21.240Z (3 months ago)
- Language: Python
- Size: 19.5 KB
- Stars: 23
- Watchers: 5
- Forks: 6
- Open Issues: 3
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
Awesome Lists containing this project
- awesome-mpython - max7219_8digit - Driver for MAX7219 8-digit 7-segment LED modules. (精选驱动库 / 显示类)
- awesome-micropython - max7219_8digit - Driver for MAX7219 8-digit 7-segment LED modules. (Libraries / Display)
README
This is a micropython library for MAX7219 + 8 x 7digit display boards.
I have tested it with both an ESP8266 and a ESP32, running micropython version 1.19.1.
Requires a minimum of three spare GPIO lines to run SPI.
Example of use:
.. code:: python
# Connections:
# SCK (CLK) -> GPIO4 (D2)
# MOSI (DIN) -> GPIO2 (D4)
# SS (CS) -> GPIO5 (D1)
from machine import Pin, SPI
import max7219_8digit
# the max7219 doesn't use the MISO, but unfortunately SoftSPI requires that
# we specify it anyway
spi = SoftSPI(baudrate=100000, polarity=1, phase=0, sck=Pin(4), mosi=Pin(2), miso=Pin(0))ss = Pin(5, Pin.OUT)
display = max7219_8digit.Display(spi, ss)
display.write_to_buffer('12345678')
display.display()
There is also a write_to_buffer_with_dots method, which attempts to use the
display decimal points properly. Note that there are some rather big bugs in
this at the moment, do not put dots at the start of the string, or put two
of them in a row... code:: python
# Connections:
# SCK (CLK) -> GPIO4 (D2)
# MOSI (DIN) -> GPIO2 (D4)
# SS (CS) -> GPIO5 (D1)
from machine import Pin, SPI
import max7219_8digit
spi = SoftSPI(baudrate=100000, polarity=1, phase=0, sck=Pin(4), mosi=Pin(2), miso=Pin(0))ss = Pin(5, Pin.OUT)
display = max7219_8digit.Display(spi, ss)
display.write_to_buffer_with_dots('1234.56.78')
display.display()