I'm a MicroPython newbie and I'm trying to get Jeff Brown's example code to run on an ESP8266 board using uPyCraft v 1.1 and MicroPython v1.12 on 2019-12-20; ESP module with ESP8266.
I can run the blink.py script with no problem. So I believe I have the board configured correctly in uPyCraft.
The max7219 4up matrix board is wired per the chart and has been tested on an arduino to work correctly.
I copied the max7219.py and example files from
https://github.com/jgbrown32/ESP8266_MAX7219 so as not to make a typo.
Example: 'ESP8266_8x8_x4_test.py'
from machine import Pin, SPI
import max7219
spi = SPI(1, baudrate=10000000)
display = Max7219(width, height, spi, cs, rotate) # line 5
# width = total width of display in pixels
# height = total height of display in pixels
# spi = SPI bus
# cs = cs (Chip Select) pin on ESP8266
# rotate = rotate display 180 degrees (Optional; default = True)
display = Max7219(8, 8, spi, Pin(15)) # line 11
display.text('A', 0, 0)
display.show()
# display.marquee(msg_to_display)
display.marquee("This is my message")
When I run the example I get :
exec(open('./ESP8266_8x8_x4_test.py').read(),globals())
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<string>", line 5, in <module>
NameError: name 'Max7219' isn't defined
line 5 is: display = Max7219(width, height, spi, cs, rotate)
if I comment out line 5 (display = Max7219(width, height, spi, cs, rotate)), I get:
exec(open('./ESP8266_8x8_x4_test.py').read(),globals())
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<string>", line 11, in <module>
NameError: name 'Max7219' isn't defined
line 11 is: display = Max7219(8, 8, spi, Pin(15))
I've tried importing max7219 and get no errors with that.
I've spent several hours on the web and can't find any reference to this specific problem.
Can someone give me an idea how to troubleshoot this?
Thank you
Tim