-
Notifications
You must be signed in to change notification settings - Fork 9
Fixed 0/180 rotation coordinates #7
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
Adds code to limit what NeoPixel coordinates are valid because some invalid Tested every NeoPixel coordinate on all four rotations, and tested every button press on all four rotations. |
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.
Thanks for the thorough testing!
adafruit_trellism4.py
Outdated
@@ -68,6 +68,8 @@ def __init__(self, pin, *, width, height, rotation=0): | |||
def __setitem__(self, index, value): | |||
if not isinstance(index, tuple) or len(index) != 2: | |||
raise IndexError("Index must be tuple") | |||
if index[0] > 7 or index[1] > 7: |
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.
I think could be a tighter check:
if index[0] >= self.width or index[1] >= self.height:
raise IndexError(...)
index[0]
is always the width, right?
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.
also check for the indexes < 0
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.
Yes, and it looks like this works. Adding now!
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.
Ok, great, and safer test for out of range at the end!
Updating https://github.com/adafruit/Adafruit_CircuitPython_BMP3XX to 1.1.0 from 1.0.0: > Merge pull request adafruit/Adafruit_CircuitPython_BMP3XX#2 from kattni/pypi-setup Updating https://github.com/adafruit/Adafruit_CircuitPython_HT16K33 to 2.1.1 from 2.1.0: > Merge pull request adafruit/Adafruit_CircuitPython_HT16K33#26 from adafruit/setup_packages > Merge pull request adafruit/Adafruit_CircuitPython_HT16K33#25 from caternuson/iss22 > Merge pull request adafruit/Adafruit_CircuitPython_HT16K33#24 from caternuson/iss21 > Merge pull request adafruit/Adafruit_CircuitPython_HT16K33#23 from caternuson/iss20 > ignore the board module imports in .pylintrc Updating https://github.com/adafruit/Adafruit_CircuitPython_TrellisM4 to 1.1.2 from f30754d: < Merge pull request adafruit/Adafruit_CircuitPython_TrellisM4#7 from kattni/coordinate-fix Updating https://github.com/adafruit/Adafruit_CircuitPython_Bundle/circuitpython_library_list.md to NA from NA: > Added the following libraries: Adafruit_CircuitPython_BluefruitSPI, Adafruit_CircuitPython_BMP3XX, Adafruit_CircuitPython_FRAM, Adafruit_CircuitPython_MLX90393, Adafruit_CircuitPython_TFmini, Adafruit_CircuitPython_TrellisM4, Adafruit_CircuitPython_VS1053
Updating https://github.com/adafruit/Adafruit_CircuitPython_FRAM to 1.1.0 from 1.0.0: > Merge pull request adafruit/Adafruit_CircuitPython_FRAM#3 from kattni/pypi Updating https://github.com/adafruit/Adafruit_CircuitPython_TFmini to 1.1.0 from 1.0.0: > Merge pull request adafruit/Adafruit_CircuitPython_TFmini#2 from kattni/pypi Updating https://github.com/adafruit/Adafruit_CircuitPython_TrellisM4 to 1.2.0 from 1.1.2: > Merge pull request adafruit/Adafruit_CircuitPython_TrellisM4#11 from kattni/pypi > Merge pull request adafruit/Adafruit_CircuitPython_TrellisM4#7 from kattni/coordinate-fix Updating https://github.com/adafruit/Adafruit_CircuitPython_VS1053 to 1.1.0 from 1.0.0: > Merge pull request adafruit/Adafruit_CircuitPython_VS1053#3 from kattni/pypi Updating https://github.com/adafruit/Adafruit_CircuitPython_Bundle/circuitpython_library_list.md to NA from NA: > Added the following libraries: Adafruit_CircuitPython_FRAM, Adafruit_CircuitPython_TFmini, Adafruit_CircuitPython_TrellisM4, Adafruit_CircuitPython_VS1053
No description provided.