Skip to content

Commit ef32614

Browse files
authored
Merge pull request #98 from tekktrik/dev/add-suspend-mode
Expose Suspend power mode
2 parents dd5733d + 095d413 commit ef32614

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

adafruit_bno055.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ def __init__(self):
213213
if chip_id != _CHIP_ID:
214214
raise RuntimeError("bad chip id (%x != %x)" % (chip_id, _CHIP_ID))
215215
self._reset()
216-
self._write_register(_POWER_REGISTER, _POWER_NORMAL)
216+
self.set_normal_mode()
217217
self._write_register(_PAGE_REGISTER, 0x00)
218218
self._write_register(_TRIGGER_REGISTER, 0x00)
219219
self.accel_range = ACCEL_4G
@@ -736,6 +736,14 @@ def axis_remap(self, remap):
736736
# Go back to normal operation mode.
737737
self._write_register(_MODE_REGISTER, current_mode)
738738

739+
def set_normal_mode(self):
740+
"""Sets the sensor to Normal power mode"""
741+
self._write_register(_POWER_REGISTER, _POWER_NORMAL)
742+
743+
def set_suspend_mode(self):
744+
"""Sets the sensor to Suspend power mode"""
745+
self._write_register(_POWER_REGISTER, _POWER_SUSPEND)
746+
739747

740748
class BNO055_I2C(BNO055):
741749
"""

0 commit comments

Comments
 (0)