Skip to content

The reset method seems inconsistent #28

@peterhinch

Description

@peterhinch

The BNO055 class reset method is user-accesible

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
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

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