LED panel client
Introduction
This will be a MicroPython client for the MQTT server. It’s going to run on a ESP8266 microcomputer using MicroPython. The LED panel will be composed of daisy-chained MAX7219 8 × 8 dot matrix LED arrays.
Currently it is just a playground to see, how to operate the LEDs. It displays a
Space Invader image. The image switches to another when the on-board FLASH
button.
Requirements
First, you need a ESP8266 microcomputer with a MicroPython firmware and a working serial connection from your computer. See documentation for further instructions.
Then, you need Python 3 with PIP. Install using brew install python
.
To connect to the MicroPython’s REPL, you need picocom. Install using bres install picocom
.
Instructions
General remark: In all further commands replace /dev/tty.wchusbserial1420
with
the actual path to your COM device.
Installation
Install this package and its dependencies using setuptools:
$ pip install --process-dependency-links --editable .
Connect the microcomputer to the macrocomputer.
Put all the necessary files onto the PyBoard using this package’s command:
$ led_panel_client_put /dev/tty.wchusbserial1420
8 × 8 matrix connection
Connect the MAX7219 dot matrix to the microcomputer. The pin pairs are in the first two columns of the following table:
MAX7219 | NodeMCU | Pin | SPI |
---|---|---|---|
VCC | 3V | ||
GND | G | ||
DIN | D7 | GPIO13 | HMOSI (mosi) |
CS | D8 | GPIO15 | GCS (cs) |
CLK | D5 | GPIO14 | HSCLK (sck) |
Run
Reset the microcomputer using the RST
button on the board. This should load
the main.py
script.
For debugging, use picocom to connect to the PyBoard’s MicroPython REPL:
picocom -b 115200 /dev/tty.wchusbserial1420
Credit
- Adafruit industries for the useful libraries
- Nauč se Python! for the MicroPython workshop
Space invaders image found somewhere on the interwebz.