Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pico example would be nice #8

Open
MartinPacker opened this issue May 31, 2023 · 3 comments
Open

Pico example would be nice #8

MartinPacker opened this issue May 31, 2023 · 3 comments

Comments

@MartinPacker
Copy link

MartinPacker commented May 31, 2023

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
Copy link
Owner

mcauser commented Jun 1, 2023

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
Copy link
Author

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
Copy link
Owner

mcauser commented Jun 1, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants