Skip to content

correcting_assertions #23

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 1 commit into from
Apr 30, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions adafruit_fxas21002c.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,12 +110,13 @@ class FXAS21002C:
_BUFFER = bytearray(7)

def __init__(self, i2c, address=_FXAS21002C_ADDRESS, gyro_range=GYRO_RANGE_250DPS):
assert gyro_range in (
if gyro_range not in (
GYRO_RANGE_250DPS,
GYRO_RANGE_500DPS,
GYRO_RANGE_1000DPS,
GYRO_RANGE_2000DPS,
)
):
raise Exception("gyro_range option selected is not a valid option")
self._gyro_range = gyro_range
self._device = i2c_dev.I2CDevice(i2c, address)
# Check for chip ID value.
Expand Down