From 516b17a997fa0810949de0950e179cec655e7095 Mon Sep 17 00:00:00 2001 From: Or Bin Date: Wed, 23 May 2018 17:52:45 +0300 Subject: [PATCH 1/2] Added information about connections for NodeMCU --- README.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index d4a7536..2c11710 100644 --- a/README.md +++ b/README.md @@ -82,7 +82,7 @@ display.text('1234',0,0,1) display.show() ``` -## Connections +## Pin Connections PyBoard | max7219 8x8 LED Matrix ------- | ---------------------- @@ -100,6 +100,14 @@ D7 MOSI (GPIO13) | DIN D8 CS (GPIO15) | CS D5 SCK (GPIO14) | CLK +NodeMCU | max7219 8x8 LED Matrix +---------------- | ---------------------- +VIN | VCC +GND | GND +D7 (GPIO13) | DIN +D8 (GPIO15) | CS +D5 (GPIO14) | CLK + ## Links * Based on [deshipu's max7219.py](https://bitbucket.org/thesheep/micropython-max7219/src) From 78051bc9f4d369bac1afa7d2f9bf8d1ae3303d93 Mon Sep 17 00:00:00 2001 From: Or Bin Date: Wed, 23 May 2018 18:12:00 +0300 Subject: [PATCH 2/2] Added another code example for ESP8266 --- README.md | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 2c11710..85f9279 100644 --- a/README.md +++ b/README.md @@ -71,6 +71,20 @@ display.show() Default baud rate of 80Mhz was introducing errors, dropped from 10Mhz and it works consistently. +**Single 8x8 LED Matrix** + +``` +import max7219 +from machine import Pin, SPI +spi = SPI(1, baudrate=10000000, polarity=0, phase=0) +display = max7219.Matrix8x8(spi, Pin(15), 1) +display.text('1', 0, 0, 1) +display.show() +``` + +**Chain of 4x 8x8 LED Matrices** +Where the 4 is drawn on the DIN matrix. + ``` import max7219 from machine import Pin, SPI @@ -78,7 +92,7 @@ spi = SPI(1, baudrate=10000000, polarity=0, phase=0) display = max7219.Matrix8x8(spi, Pin(15), 4) display.brightness(0) display.fill(0) -display.text('1234',0,0,1) +display.text('1234', 0, 0, 1) display.show() ```