-
Notifications
You must be signed in to change notification settings - Fork 36
Adding rotary QT NeoPixel example. #73
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
Conversation
import adafruit_pypixelbuf as _pixelbuf | ||
|
||
# For use with the STEMMA connector on QT Py RP2040 | ||
# import busio |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is busio the thing to import here? This is actually a point I'm trying to get a better handle on--when and when not to import busio
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
busio
only need to be imported if you have to specify individual I2C pins or I2C pins other than SCL and SDA. Otherwise, use board.I2C()
which is basically an object representing board.SCL, board.SDA
. In the case of the QT Py RP2040 STEMMA connector, it's SDA1 and SCL1, so it would need busio
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, that clears it up, I was afraid I needed to worry about clock timing issues on boards and I just didn't know how to begin knowing when and when not to use it.
Thank you for the explanation!
if position != last_position: | ||
print(position) | ||
|
||
if switch.value: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you rotate the encoder, and then wait a bit before you press the switch I don't believe this code executes. Is that the intended behavior or should this if switch.value
call be outside of the if position != last_position
, or am I not reading this code correctly (I do need to top off my coffee).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code executes when I try to replicate what you're suggesting. I'm not sure if I'm simply not doing it in the manner you're suggesting or if the code is fine. I'm going to merge this, we can continue the discussion if you have suggestions and I can make changes if needed in another PR.
Updating https://github.com/adafruit/Adafruit_CircuitPython_ESP32SPI to 3.5.11 from 3.5.10: > Moved default branch to main > Merge pull request adafruit/Adafruit_CircuitPython_ESP32SPI#115 from Anton-2/master Updating https://github.com/adafruit/Adafruit_CircuitPython_Seesaw to 1.9.1 from 1.9.0: > Merge pull request adafruit/Adafruit_CircuitPython_seesaw#74 from jposada202020/adding_new_example > Merge pull request adafruit/Adafruit_CircuitPython_seesaw#73 from kattni/rotary-neopixel-example > Merge pull request adafruit/Adafruit_CircuitPython_seesaw#71 from jposada202020/adding_new_guides Updating https://github.com/adafruit/Adafruit_CircuitPython_SSD1325 to 1.2.5 from 1.2.4: > Moved default branch to main > Moved CI to Python 3.7 > Added help text and problem matcher > Added pull request template > "Increase duplicate code check threshold " Updating https://github.com/adafruit/Adafruit_CircuitPython_Wiznet5k to 1.10.3 from 1.10.2: > Merge pull request adafruit/Adafruit_CircuitPython_Wiznet5k#38 from bjnhur/master > Redoing adafruit/Adafruit_CircuitPython_Wiznet5k#37 Updating https://github.com/adafruit/Adafruit_CircuitPython_BLE to 8.0.2 from 8.0.1: > Merge pull request adafruit/Adafruit_CircuitPython_BLE#116 from alexwhittemore/master > Moved default branch to main > Added help text and problem matcher > Added pull request template Updating https://github.com/adafruit/Adafruit_CircuitPython_ImageLoad to 0.14.2 from 0.14.1: > Moved default branch to main > Moved CI to Python 3.7 > Added help text and problem matcher > Added pull request template Updating https://github.com/adafruit/Adafruit_CircuitPython_Simple_Text_Display to 1.0.1 from 1.0.0: > Merge pull request adafruit/Adafruit_CircuitPython_Simple_Text_Display#1 from jposada202020/testing_readthedocs
No description provided.