Skip to content

Commit

Permalink
Merge pull request #23 from jposada202020/correcting_assertions
Browse files Browse the repository at this point in the history
correcting_assertions
  • Loading branch information
tannewt authored Apr 30, 2021
2 parents 529b66a + 198ffe0 commit 33ad835
Showing 1 changed file with 3 additions and 2 deletions.
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

0 comments on commit 33ad835

Please sign in to comment.