mcauser / micropython-max7219

MicroPython driver for MAX7219 8x8 LED matrix modules, cascadable and with framebuf
MIT License
182 stars 57 forks source link

Pico example would be nice #8

Open MartinPacker opened 1 year ago

MartinPacker commented 1 year ago

Thank you for a very handy library. I've only just come across this device and the library to drive it.

A coding example for Raspberry Pi Pico would be nice. Perhaps one of the other ones could be used; I wouldn't know. All I know is Pin('X5') causes a syntax error on MicroPython on Pico - as it doesn't have such a pin name.

mcauser commented 1 year ago

The machine.Pin() class works slightly differently on each port.

On the RP2 pico port, pins are represented as integers. https://docs.micropython.org/en/latest/rp2/quickref.html#pins-and-gpio Replace the Pin('X5') with Pin(5)

X5 is a STM32 port pin number, where I originally worked on this driver.

It's been quite a few years since I worked on this. I'll add some more examples and test against the newer micropython versions.

MartinPacker commented 1 year ago

Thank you. Elsewhere I saw integer 5 - and it worked. Just a note would do, rather than a whole new example. Unless you want to create new examples.

mcauser commented 1 year ago

I've got plenty of unfinished unmerged ones. Just need to find some time to upgrade, polish and commit.