Anyone working on a MAX7219 8x8 LED matrix display library?

Discuss development of drivers for external hardware and components, such as LCD screens, sensors, motor drivers, etc.
Target audience: Users and developers of drivers.
DJShadow1966
Posts: 56
Joined: Sun Jun 23, 2019 4:55 am
Location: Gateshead, Tyne and Wear

Re: Anyone working on a MAX7219 8x8 LED matrix display library?

Post by DJShadow1966 » Mon Dec 02, 2019 3:00 pm

Hello

I did the changes as above, but now I get a solid line accross the top of the display, when I undo the changes apart from each image 180 degress out I have no problems.

Can you please advise.

Regards Mike

jgbrown
Posts: 6
Joined: Sun Nov 10, 2019 11:52 pm

Re: Anyone working on a MAX7219 8x8 LED matrix display library?

Post by jgbrown » Mon Dec 02, 2019 5:53 pm

Here's a link to the repository so you can use the exact file to alleviate chances of typo's, etc....and in case I made any last minute changes.

https://github.com/jgbrown32/ESP8266_MAX7219

-- Jeff

DJShadow1966
Posts: 56
Joined: Sun Jun 23, 2019 4:55 am
Location: Gateshead, Tyne and Wear

Re: Anyone working on a MAX7219 8x8 LED matrix display library?

Post by DJShadow1966 » Wed Dec 04, 2019 8:43 am

Hello Jeff
Many thanks for that got it all sorted.
Mike

tgs901
Posts: 3
Joined: Tue Jul 21, 2020 5:42 pm

Problem getting MAX7219 Matrix display to work

Post by tgs901 » Tue Jul 21, 2020 6:32 pm

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

jgbrown
Posts: 6
Joined: Sun Nov 10, 2019 11:52 pm

Re: Anyone working on a MAX7219 8x8 LED matrix display library?

Post by jgbrown » Tue Jul 21, 2020 7:47 pm

Hi Tim --

It's been a while since I've done anything with this, but there may be a typo in the code. For line 5, try:

display = max7219.Max7219(width, height, spi, cs, rotate)

Let me know if that works.

-- Jeff

tgs901
Posts: 3
Joined: Tue Jul 21, 2020 5:42 pm

Re: Anyone working on a MAX7219 8x8 LED matrix display library?

Post by tgs901 » Wed Jul 22, 2020 12:45 am

Hi Jeff,

Now I get this:
.....
download ok
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 'width' isn't defined
>>>

Tim

tgs901
Posts: 3
Joined: Tue Jul 21, 2020 5:42 pm

Re: Anyone working on a MAX7219 8x8 LED matrix display library?

Post by tgs901 » Wed Jul 22, 2020 12:51 am

Hi Jeff,

I think I've figured it out.
line 5 should be a comment.
line 10 should have your fix in it

line 5 --> #display = max7219.Max7219(width, height, spi, cs, rotate)
line 10 --> display = max7219.Max7219(32, 8, spi, Pin(15),4)

Now it works.
Thank you
Tim

jgbrown
Posts: 6
Joined: Sun Nov 10, 2019 11:52 pm

Re: Anyone working on a MAX7219 8x8 LED matrix display library?

Post by jgbrown » Wed Jul 22, 2020 10:13 pm

Thanks Tim...you are right. I went directly to main.py and saw your syntax error and replied. I have updated the README with your feedback so hopefully it doesn't trip anyone else up.

-- Jeff

Post Reply