Skip to content

Commit 2064bdb

Browse files
authored
Merge pull request #52 from adafruit/docs-update
Added documentation for modes
2 parents 9e5371d + 9f950aa commit 2064bdb

File tree

2 files changed

+72
-7
lines changed

2 files changed

+72
-7
lines changed

adafruit_bno055.py

Lines changed: 71 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -143,13 +143,8 @@ def _reset(self):
143143
@property
144144
def mode(self):
145145
"""
146-
Switch the mode of operation and return the previous mode.
147-
148-
Mode of operation defines which sensors are enabled and whether the
149-
measurements are absolute or relative.
150-
If a sensor is disabled, it will return an empty tuple.
151-
152146
legend: x=on, -=off
147+
153148
+------------------+-------+---------+------+----------+
154149
| Mode | Accel | Compass | Gyro | Absolute |
155150
+==================+=======+=========+======+==========+
@@ -181,6 +176,76 @@ def mode(self):
181176
+------------------+-------+---------+------+----------+
182177
183178
The default mode is ``NDOF_MODE``.
179+
180+
| You can set the mode using the line below:
181+
| ``sensor.mode = adafruit_bno055.ACCONLY_MODE``
182+
| replacing ``ACCONLY_MODE`` with the mode you want to use
183+
184+
.. data:: CONFIG_MODE
185+
186+
This mode is used to configure BNO, wherein all output data is reset to zero and sensor
187+
fusion is halted.
188+
189+
.. data:: ACCONLY_MODE
190+
191+
In this mode, the BNO055 behaves like a stand-alone acceleration sensor. In this mode the
192+
other sensors (magnetometer, gyro) are suspended to lower the power consumption.
193+
194+
.. data:: MAGONLY_MODE
195+
196+
In MAGONLY mode, the BNO055 behaves like a stand-alone magnetometer, with acceleration
197+
sensor and gyroscope being suspended.
198+
199+
.. data:: GYRONLY_MODE
200+
201+
In GYROONLY mode, the BNO055 behaves like a stand-alone gyroscope, with acceleration
202+
sensor and magnetometer being suspended.
203+
204+
.. data:: ACCMAG_MODE
205+
206+
Both accelerometer and magnetometer are switched on, the user can read the data from
207+
these two sensors.
208+
209+
.. data:: ACCGYRO_MODE
210+
211+
Both accelerometer and gyroscope are switched on; the user can read the data from these
212+
two sensors.
213+
214+
.. data:: MAGGYRO_MODE
215+
216+
Both magnetometer and gyroscope are switched on, the user can read the data from these
217+
two sensors.
218+
219+
.. data:: AMG_MODE
220+
221+
All three sensors accelerometer, magnetometer and gyroscope are switched on.
222+
223+
.. data:: IMUPLUS_MODE
224+
225+
In the IMU mode the relative orientation of the BNO055 in space is calculated from the
226+
accelerometer and gyroscope data. The calculation is fast (i.e. high output data rate).
227+
228+
.. data:: COMPASS_MODE
229+
230+
The COMPASS mode is intended to measure the magnetic earth field and calculate the
231+
geographic direction.
232+
233+
.. data:: M4G_MODE
234+
235+
The M4G mode is similar to the IMU mode, but instead of using the gyroscope signal to
236+
detect rotation, the changing orientation of the magnetometer in the magnetic field is
237+
used.
238+
239+
.. data:: NDOF_FMC_OFF_MODE
240+
241+
This fusion mode is same as NDOF mode, but with the Fast Magnetometer Calibration turned
242+
‘OFF’.
243+
244+
.. data:: NDOF_MODE
245+
246+
This is a fusion mode with 9 degrees of freedom where the fused absolute orientation data
247+
is calculated from accelerometer, gyroscope and the magnetometer.
248+
184249
"""
185250
return self._read_register(_MODE_REGISTER)
186251

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# Uncomment the below if you use native CircuitPython modules such as
1616
# digitalio, micropython and busio. List the modules you use. Without it, the
1717
# autodoc module docs will fail to generate with a warning.
18-
# autodoc_mock_imports = ["adafruit_bus_device", "micropython", "adafruit_register"]
18+
autodoc_mock_imports = ["adafruit_bus_device", "micropython", "adafruit_register"]
1919

2020
intersphinx_mapping = {
2121
"python": ("https://docs.python.org/3.4", None),

0 commit comments

Comments
 (0)