Skip to content

Incompatible with PyBadge LC #53

Closed
@FoamyGuy

Description

@FoamyGuy

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions