Skip to content

Expose Suspend power mode #98

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
Mar 4, 2022
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
10 changes: 9 additions & 1 deletion adafruit_bno055.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ def __init__(self):
if chip_id != _CHIP_ID:
raise RuntimeError("bad chip id (%x != %x)" % (chip_id, _CHIP_ID))
self._reset()
self._write_register(_POWER_REGISTER, _POWER_NORMAL)
self.set_normal_mode()
self._write_register(_PAGE_REGISTER, 0x00)
self._write_register(_TRIGGER_REGISTER, 0x00)
self.accel_range = ACCEL_4G
Expand Down Expand Up @@ -736,6 +736,14 @@ def axis_remap(self, remap):
# Go back to normal operation mode.
self._write_register(_MODE_REGISTER, current_mode)

def set_normal_mode(self):
"""Sets the sensor to Normal power mode"""
self._write_register(_POWER_REGISTER, _POWER_NORMAL)

def set_suspend_mode(self):
"""Sets the sensor to Suspend power mode"""
self._write_register(_POWER_REGISTER, _POWER_SUSPEND)


class BNO055_I2C(BNO055):
"""
Expand Down