Skip to content

Pybadge LC compatibility #54

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

Merged
merged 4 commits into from
Dec 13, 2021
Merged

Conversation

FoamyGuy
Copy link
Contributor

@FoamyGuy FoamyGuy commented Dec 5, 2021

resolves: #53

This change will run an i2c.scan() and check for the presence of the accelerometer (addresses 0x18 or 0x19) before attempting to initialize it. I believe this should make the library compatible with the PyBadge LC variant which does not have the accelerometer populated.

I tested the updated library using the simpletest with an Edge Badge to ensure that accelerometer readings are still working normally.

I don't have the LC variant of the hardware. But it would be great if someone who does can test this change on it as well to ensure there isn't something I missed still causing incompatibility.

@FoamyGuy FoamyGuy changed the title Pybadge lc compatibility Pybadge LC compatibility Dec 5, 2021
@FoamyGuy
Copy link
Contributor Author

FoamyGuy commented Dec 5, 2021

I am going to cancel the current actions workflow for this PR because sphinx is stuck in an infinite loop due to the while statement that is trying to lock the I2C bus.

@ladyada ladyada requested a review from kattni December 5, 2021 18:42
@FoamyGuy
Copy link
Contributor Author

FoamyGuy commented Dec 5, 2021

Alright. It's' passing actions checks now. I changed the try_lock() logic from an infinite loop to attempt at most 10 times and then give up.

Re-tested with the latest version on EdgeBadge and acceleration readings do still work properly on that device.

Copy link
Contributor

@kattni kattni left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested successfully on 7.0.0. Thanks for adding this!

@kattni kattni merged commit dad4acf into adafruit:main Dec 13, 2021
adafruit-adabot added a commit to adafruit/Adafruit_CircuitPython_Bundle that referenced this pull request Dec 15, 2021
Updating https://github.com/adafruit/Adafruit_CircuitPython_MAX7219 to 1.5.0 from 1.4.1:
  > Merge pull request adafruit/Adafruit_CircuitPython_MAX7219#37 from FlantasticDan/chainable-matrices
  > update rtd py version

Updating https://github.com/adafruit/Adafruit_CircuitPython_PyBadger to 3.6.1 from 3.6.0:
  > Merge pull request adafruit/Adafruit_CircuitPython_PyBadger#56 from FoamyGuy/rename_mag_tag
  > Merge pull request adafruit/Adafruit_CircuitPython_PyBadger#54 from FoamyGuy/pybadge_lc_compatibility
  > update rtd py version
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

Successfully merging this pull request may close these issues.

Incompatible with PyBadge LC
2 participants