Closed FoamyGuy closed 2 years ago
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.
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.
resolves: #53
This change will run an
i2c.scan()
and check for the presence of the accelerometer (addresses0x18
or0x19
) 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.