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.
User avatar
mcauser
Posts: 356
Joined: Mon Jun 15, 2015 8:03 am

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

Post by mcauser » Wed Apr 11, 2018 9:22 pm

Hi Rob,

Try replacing:
d.text=("7219",0,0,1)
With:
d.text("7219",0,0,1)

RobH
Posts: 15
Joined: Fri Mar 23, 2018 3:37 pm
Location: Netherlands
Contact:

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

Post by RobH » Thu Apr 12, 2018 7:22 am

[duplicate removed]
Last edited by RobH on Thu Apr 12, 2018 12:03 pm, edited 1 time in total.

RobH
Posts: 15
Joined: Fri Mar 23, 2018 3:37 pm
Location: Netherlands
Contact:

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

Post by RobH » Thu Apr 12, 2018 7:39 am

Sorry for the duplicate posting... overlooked 'next' pages.
@mcauser: Thanks for pointing me to the superfluous equal signs, but removing made no difference... searching further.

User avatar
mcauser
Posts: 356
Joined: Mon Jun 15, 2015 8:03 am

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

Post by mcauser » Thu Apr 12, 2018 9:12 am

I’ll flash the latest version of micropython to my Wemos D1 mini and see if I can replicate the issue.

RobH
Posts: 15
Joined: Fri Mar 23, 2018 3:37 pm
Location: Netherlands
Contact:

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

Post by RobH » Thu Apr 12, 2018 12:29 pm

Just tested the quad 8x8 display on a PyBoard: both text display and scrolling work fine for this combination! :D
Rob.

RobH
Posts: 15
Joined: Fri Mar 23, 2018 3:37 pm
Location: Netherlands
Contact:

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

Post by RobH » Sat Apr 14, 2018 10:04 am

I must have made a mistake (maybe more that one!) with my initial attempts! After migrating the program which worked on the PyBoard to the ESP32 and ESP8266 it works on these platforms too! On the ESP8266 both with hardware and software SPI, on the ESP32 only sw-SPI. I'll try to find out the problem with hw-SPI on the ESP32.

RobH
Posts: 15
Joined: Fri Mar 23, 2018 3:37 pm
Location: Netherlands
Contact:

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

Post by RobH » Fri Feb 15, 2019 1:49 pm

@mcauser, suggestion for enhancement.
I have a couple of PCBs with a single monochrome 8x8 matrix and a max7219 'outside' of the PCB, probably the same as you show in a picture you posted in this forum (1 Oct 2017). With 3 of these I would like to build a 24(hor.) x 8(vert.) matrix by mounting these side-by-side with the MAX7219 below (or above) the LEDs. However when displaying text the characters are 90 degrees rotated, effectively a 8 (hor.) x 24 (vert.) display.
I have done some experiments: (1) with an external font table, rotating the font pattern and using the blit() method and (2) by a modification of the library: MONO_HLSB into MONO_VLSB. Both work fine for a single 8x8 matrix but I couldn't get this right for multiple matrices. I would appreciate some help...

Addition dd feb 19, 2019: found a solution (maybe not the most elegant!):
1. In stead of writing line-by-line, write column-by-column
2. Reverse the order of writing the modules: right to left (last module in chain first).
Thus the show-method (between self.cs(0) and self.cs(1)) becomes:

Code: Select all

	mask = 0x80 >> y                                   # collect 'y'-th column
        for m in range(self.num-1, -1, -1):                # right most module first
            col = 0x00                                     # initial contents 'y'-th column
            for bit in range(8):                           # all bits in column
                if self.buffer[bit * self.num + m] & mask:
                    col |= 1 << bit                        # copy 1-bit to column pattern
            self.spi.write(bytearray([_DIGIT0 + y, col]))
Result see attached picture.
I just needed this for text, but graphics like lines and rectangles work also nicely.

Regards, Rob
Attachments
max7219_chain.jpg
max7219_chain.jpg (52.15 KiB) Viewed 125 times

Post Reply