-
Notifications
You must be signed in to change notification settings - Fork 11
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
2023 - circuit python 8.0.3 - sequential pins rotaryio? #4
Comments
Looks like you're using a QT Py RP2040. This project was created before those existed, and only works with the original QT Py M0. |
Oh interesting, I wasn't sure why that might be happening! |
Sorry to bump, but @xgpt , did you find a workaround? I may just cut my pins and bridge with wires to sequential pins... :/ And @todbot , would you be willing to update the "components" section to call out the M0? I didn't realize there were different versions of the QT Pi and I didn't order directly from the link. Thank you both! |
@adalovebass Yep I'll do that. I'll also see about a solution for the RP2040. |
That's awesome! Technically I'm on a xiao-rp2040, but all the pins are in the same spot as the QT Pi, I just have less memory (and need to cherry-pick my python modules). |
I'm out of town and away from my desk, but I can look at the prototype I ended up with and send you a schematic of the pinout when I get back from my trip! |
Ooo, @xgpt, I'd love to see that! I also just updated |
Omgosh thank you both! I am kind of new, so figured I could remove the rotary encoder lead from D1 and wire it to D4 instead, so the pins used were D3 and D4: But apparently in the GPIO sense D3 and D4 are not actually sequential. I found this thread that mentions This seems like a potential location for the rotary encoder, if you can do a fake ground on D10 for the push-button. Unfortunately, between my D3/D4 attempt, and moving the bridging wire from D4 to D5, my board doesn't seem to be recognized by Windows any more (have tried unsoldering everything, and boot mode, to no avail) (and it was a comparatively clean, cool, and successful desoldering and resoldering, so not sure what's happening with that). 😄 Regardless, I haven't been able to run In the meantime, thanks for the update to use fakerotaryio, I'll check it out when my new board shows up 😭 (I bought 2 so I can put header pins in one and prototype on a breadboard this time!) |
@adalovebass looks like you're running Adafruit QTPy firmware on that XIAO. They're pretty different internally, I'd recommend installing XIAO RP2040 CircuitPython |
Thanks for lookin' out for me! To clarify, I am running the firmware you linked, the output of the |
@adalovebass ahh got it! In the XIAO pinout diagram, the gray labels are the chip GPIO pin numbers and it's those that must be sequential. (e.g. D3 & D5 are GPIO P29 & P7) It's confusing and I've been bit by it multiple times too, with both rotary encoders and I2S audio. And it doesn't help that |
Oh gosh! :D Yeah, the message about GPIO pins meaning "micropython pin numbers" was certainly not clear! But it does seem like D10 and D8 would be sequential, as their micropython pin numbers are P3 and P2. I figure I can get D9 to do the "fake ground." Then I see your code uses MISO and MOSI (shared with D8 and D9) for the Neopixel Ring and Rotary Encoder's button, but I am pretty sure those can use any digital pin based on some other example I've seen. I'll let you know if I find a solution that works with the standard rotaryio library. I really appreciate you sharing your expertise, and hope this is all still relevant to this ticket :) |
So I did find a solution that works:
Code changes:
Since I have limited storage space I manually added these to /lib directory:
Zip file with libraries here: https://github.com/adafruit/Adafruit_CircuitPython_Bundle/releases/tag/20231013 Specifically I used the 8.x bundle from there (direct link here: https://github.com/adafruit/Adafruit_CircuitPython_Bundle/releases/download/20231013/adafruit-circuitpython-bundle-8.x-mpy-20231013.zip ) Of course the .stl's won't necessarily fit, as the USB port and encoder knob are now on opposite sides of the board. BUT, it's possible to run this on the XIAO RP2040, using the elegant direct-mounting-of-encoder-to-board solution! |
le.
main.py output:
Traceback (most recent call last):
File "main.py", line 30, in
RuntimeError: Pins must be sequential GPIO pins
Code done running.
Press any key to enter the REPL. Use CTRL-D to reload.
The text was updated successfully, but these errors were encountered: