-
Notifications
You must be signed in to change notification settings - Fork 35
Adding examples for ANO rotary encoder #115
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
Adding two examples for the ANO rotary encoder. Ports of the Arduino example code.
👋 Thanks for this pull request! Unfortunately, it looks like the automated continuous integration (CI) test(s) failed. These can be tricky to fix so we've written a guide on how to fix them locally. It has pages about running pre-commit locally and another about building the docs locally with sphinx. Thanks for contributing to CircuitPython! If you have more questions, feel free to join the Adafruit Discord and post in #circuitpython-dev. |
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.
Didn't test but looks good! I added a couple suggestions for improvements (applies to both files but added to just one). The one about zip()
is your call!
|
||
if position != last_position: | ||
last_position = position | ||
display.print(" %s" % str(position)) |
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.
This can be updated to use f-strings, same thing for other uses of "x" % y
and "x".format(y)` in the code.
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.
added f-strings yesterday. not sure why friday night i used .format instead 😅
it would be helpful if i actually updated the examples to use f-strings 😅
display = segments.Seg14x4(i2c, address=0x70) | ||
|
||
seesaw_product = (seesaw.get_version() >> 16) & 0xFFFF | ||
print("Found product {}".format(seesaw_product)) |
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.
Looks like there's a remaining use of format()
for each example.
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.
You could even use print("Found product", seesaw_product)
here too.
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.
whoops! missed those
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.
Awesome, looks good to me!
thanks for reviewing! |
Updating https://github.com/adafruit/Adafruit_CircuitPython_BNO055 to 5.4.10 from 5.4.9: > Reformatted per pre-commit > Update .pylintrc, fix jQuery for docs > Update pre-commit hooks Updating https://github.com/adafruit/Adafruit_CircuitPython_INA260 to 1.3.13 from 1.3.12: > Merge pull request adafruit/Adafruit_CircuitPython_INA260#26 from adafruit/dev/fix-pylint-jquery > Merge pull request adafruit/Adafruit_CircuitPython_INA260#25 from tekktrik/dev/fix-pylint > Update pre-commit hooks > Add upload url to release action > Add .venv to .gitignore Updating https://github.com/adafruit/Adafruit_CircuitPython_Nunchuk to 1.1.8 from 1.1.7: > Update .pylintrc, fix jQuery for docs > Run pre-commit > Update pre-commit hooks > Merge pull request adafruit/Adafruit_CircuitPython_Nunchuk#34 from adafruit/thirdparty_nunchuk > Add upload url to release action Updating https://github.com/adafruit/Adafruit_CircuitPython_PCA9685 to 3.4.10 from 3.4.9: > Merge pull request adafruit/Adafruit_CircuitPython_PCA9685#56 from adafruit/dev/fix-plyint-jquery > Merge pull request adafruit/Adafruit_CircuitPython_PCA9685#53 from DrRob/fix-duty-cycle Updating https://github.com/adafruit/Adafruit_CircuitPython_Seesaw to 1.13.0 from 1.12.1: > Merge pull request adafruit/Adafruit_CircuitPython_seesaw#117 from kattni/add-gamepad-qt > Update .pylintrc, fix jQuery for docs > Merge pull request adafruit/Adafruit_CircuitPython_seesaw#115 from adafruit/ano_rotary_examples Updating https://github.com/adafruit/Adafruit_CircuitPython_SSD1306 to 2.12.14 from 2.12.13: > Update .pylintrc, fix jQuery for docs > Merge pull request adafruit/Adafruit_CircuitPython_SSD1306#80 from DJDevon3/WorkingBranch Updating https://github.com/adafruit/Adafruit_CircuitPython_Debouncer to 2.0.6 from 2.0.5: > Merge pull request adafruit/Adafruit_CircuitPython_Debouncer#42 from tekktrik/dev/move-hw-unittest > Update .pylintrc, fix jQuery for docs > Update pre-commit hooks > Add upload url to release action > Add .venv to .gitignore > Update .pylintrc for v2.15.5 > Fix release CI files > Update pylint to 2.15.5 > Updated pylint version to 2.13.0 > Switching to composite actions Updating https://github.com/adafruit/Adafruit_CircuitPython_MacroPad to 2.2.1 from 2.2.0: > Update .pylintrc, fix jQuery for docs > Run pre-commit > Update pre-commit hooks > Merge pull request adafruit/Adafruit_CircuitPython_MacroPad#46 from kalehmann/fix-45/wake-display-during-init Updating https://github.com/adafruit/Adafruit_CircuitPython_Bundle/circuitpython_library_list.md to NA from NA: > Updated download stats for the libraries
Adding two examples for the ANO rotary encoder. Ports of the Arduino example code.