Skip to content

Incompatible with PyBadge LC #53

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

Closed
FoamyGuy opened this issue Dec 3, 2021 · 0 comments · Fixed by #54
Closed

Incompatible with PyBadge LC #53

FoamyGuy opened this issue Dec 3, 2021 · 0 comments · Fixed by #54

Comments

@FoamyGuy
Copy link
Contributor

FoamyGuy commented Dec 3, 2021

I think this library currently assumes that if the I2C bus exists then the accelerometer will as well with the code from here:

if i2c is None:
try:
i2c = board.I2C()
except RuntimeError:
self._accelerometer = None
if i2c is not None:
int1 = digitalio.DigitalInOut(board.ACCELEROMETER_INTERRUPT)
try:
self._accelerometer = adafruit_lis3dh.LIS3DH_I2C(
i2c, address=0x19, int1=int1
)
except ValueError:
self._accelerometer = adafruit_lis3dh.LIS3DH_I2C(i2c, int1=int1)

Since the PyBadge LC does not have the accelerometer populated this ends up raising an exception.

We could possible handle the missing accelerometer more gracefully and allow the remaining portions of the library that are supported by the LC hardware to work.

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 a pull request may close this issue.

1 participant