-
Notifications
You must be signed in to change notification settings - Fork 54
Closed
Description
The BNO055 class reset method is user-accesible
Adafruit_CircuitPython_BNO055/adafruit_bno055.py
Lines 148 to 156 in 32a5a8a
def reset(self): | |
"""Resets the sensor to default settings.""" | |
self.mode = CONFIG_MODE | |
try: | |
self._write_register(_TRIGGER_REGISTER, 0x20) | |
except OSError: # error due to the chip resetting | |
pass | |
# wait for the chip to reset (650 ms typ.) | |
time.sleep(0.7) |
If a user calls this method, my reading of the datasheet is that the behaviour of the chip is equivalent to a power-on or a pulse on the reset line. It therefore seems inconsistent that the constructor, after calling reset(), issues
Adafruit_CircuitPython_BNO055/adafruit_bno055.py
Lines 128 to 133 in 32a5a8a
self._write_register(_POWER_REGISTER, _POWER_NORMAL) | |
self._write_register(_PAGE_REGISTER, 0x00) | |
self._write_register(_TRIGGER_REGISTER, 0x00) | |
time.sleep(0.01) | |
self.mode = NDOF_MODE | |
time.sleep(0.01) |
Either these lines are redundant or they should be included in the reset method. Alternatively user access could be discouraged by renaming it _reset.
Metadata
Metadata
Assignees
Labels
No labels