Skip to content
This repository was archived by the owner on Jul 20, 2025. It is now read-only.

Commit a71ac0a

Browse files
committed
update docs
1 parent 97598a9 commit a71ac0a

File tree

4 files changed

+158
-5
lines changed

4 files changed

+158
-5
lines changed

docs/source/accelerometer.rst

Lines changed: 132 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ necessary. ::
2222
break;
2323
MBL_MW_MODULE_ACC_TYPE_BMA255:
2424
break;
25+
MBL_MW_MODULE_ACC_TYPE_BMI270:
26+
break;
2527
MBL_MW_MODULE_TYPE_NA:
2628
break;
2729
default:
@@ -79,6 +81,121 @@ and is only for streaming; do not use it with data processing or logging. ::
7981
libmetawear.mbl_mw_acc_enable_acceleration_sampling(board)
8082
libmetawear.mbl_mw_acc_start(board)
8183

84+
Wrist Wear Gestures
85+
---------------------
86+
The BMI270 is designed for Wear OS by GoogleTM7 and features wrist gestures such as flick in/out, push arm down/pivot up, wrist jiggle/shake that help navigate the smartwatch.
87+
88+
See https://support.google.com/wearos/answer/6312406?hl=en
89+
90+
For flick-in detection, the user must slowly turn the wrist away from the body (i.e. roll-out shown with a light-grey arrow in) and then quickly bring it back (i.e. roll-in shown with a darker-black arrow in to its original position.
91+
92+
For flick-out detection, the user must quickly turn the wrist away from the body (i.e. roll-out shown with a darker-black arrow in above picture) and then slowly bring it back (i.e. roll-in shown with a light-grey arrow in above picture) to its original position.
93+
94+
The speed of the roll-out and roll-in movements determine if the user performed a flick-in or a flick-out movement. ::
95+
96+
// Start the accelerometer
97+
libmetawear.mbl_mw_acc_start(board)
98+
// Configure
99+
libmetawear.mbl_mw_acc_bmi270_wrist_gesture_armside(board, 0) // left arm
100+
libmetawear.mbl_mw_acc_bmi270_write_wrist_gesture_config(board)
101+
// Get gesture signal
102+
gesture_signal = libmetawear.mbl_mw_acc_bmi270_get_wrist_detector_data_signal(board)
103+
libmetawear.mbl_mw_datasignal_subscribe(gesture_sig, None, sensor_data_handler)
104+
// Start detecting motion and turn on acc
105+
libmetawear.mbl_mw_acc_bmi270_enable_wrist_gesture(board)
106+
107+
There are config functions for the wrist wear feature: ::
108+
109+
libmetawear.mbl_mw_acc_bmi270_wrist_gesture_peak()
110+
libmetawear.mbl_mw_acc_bmi270_wrist_gesture_samples()
111+
libmetawear.mbl_mw_acc_bmi270_wrist_gesture_duration()
112+
113+
Activity Detector
114+
------------------
115+
The BMI270 can detect simple user activities (unknown, still, walking, running) and can send an interrupt if those are changed, e.g. from walking to running or vice versus. ::
116+
117+
// Start the accelerometer
118+
libmetawear.mbl_mw_acc_start(board)
119+
// Get activity signal
120+
activity_sig = libmetawear.mbl_mw_acc_bmi270_get_activity_detector_data_signal(board)
121+
libmetawear.mbl_mw_datasignal_subscribe(activity_sig, None, sensor_data_handler)
122+
// Start detecting motion and turn on acc
123+
libmetawear.mbl_mw_acc_bmi270_enable_activity_detection(board)
124+
125+
Wrist Wear Wakeup
126+
----------------------
127+
The BMI270 has a wrist wear wakeup feature that is designed to detect any natural way of user moving the hand to see the watch dial when wearing a classical wrist watch.
128+
129+
The feature is intended to be used as wakeup gesture (i.e. for triggering screen-on or screen-off) in wrist wearable devices.
130+
131+
This feature has dependency on the device orientation in the user system. Implementation of the feature to detect gesture assumes that the sensor co-ordinate frame is aligned with the device/system co- ordinate frame. The assumed default device/system co-ordinate frame is depicted below.
132+
133+
Please refer to `this section <https://mbientlab.com/documents/metawear/cpp/latest/accelerometer__bosch_8h.html#aca2fa97988a33550e20b02c816c6b91f>`_ regarding axis remapping. ::
134+
135+
// Start the accelerometer
136+
libmetawear.mbl_mw_acc_start(board)
137+
// Get gesture signal
138+
wrist_sig = libmetawear.mbl_mw_acc_bmi270_get_wrist_detector_data_signal(board)
139+
libmetawear.mbl_mw_datasignal_subscribe(wrist_sig, None, sensor_data_handler)
140+
// Start detecting motion and turn on acc
141+
libmetawear.mbl_mw_acc_bmi270_enable_wrist_wakeup(board)
142+
143+
There are config functions for the wrist wear feature: ::
144+
145+
libmetawear.mbl_mw_acc_bmi270_wrist_wakeup_angle_focus()
146+
libmetawear.mbl_mw_acc_bmi270_wrist_wakeup_angle_nonfocus()
147+
libmetawear.mbl_mw_acc_bmi270_wrist_wakeup_tilt_lr()
148+
libmetawear.mbl_mw_acc_bmi270_wrist_wakeup_tilt_ll()
149+
libmetawear.mbl_mw_acc_bmi270_wrist_wakeup_tilt_pd()
150+
libmetawear.mbl_mw_acc_bmi270_wrist_wakeup_tilt_pu()
151+
152+
Motion Detector
153+
----------------
154+
The BMI270 can detect significant motion (android motion), any motion (high acc motion) or no motion. The accelerometer must be at least running at 25Hz.
155+
156+
Detect Any Motion
157+
^^^^^^^^^^^^^^^^^^^
158+
The anymotion detection uses the slope between two acceleration signals to detect changes in motion. ::
159+
160+
// Start the accelerometer
161+
libmetawear.mbl_mw_acc_start(board)
162+
// Set any motion config - acc must be on for this
163+
libmetawear.mbl_mw_acc_bosch_set_any_motion_count(board, 5)
164+
libmetawear.mbl_mw_acc_bosch_set_any_motion_threshold(board, 170.0)
165+
libmetawear.mbl_mw_acc_bosch_write_motion_config(board, MBL_MW_ACC_BOSCH_MOTION_ANYMOTION)
166+
// Get any motion signal
167+
any_motion = libmetawear.mbl_mw_acc_bosch_get_motion_data_signal(board);
168+
libmetawear.mbl_mw_datasignal_subscribe(any_motion, None, sensor_data_handler)
169+
// Start detecting motion
170+
libmetawear.mbl_mw_acc_bosch_enable_motion_detection(board, MBL_MW_ACC_BOSCH_MOTION_ANYMOTION)
171+
172+
Detect No Motion
173+
^^^^^^^^^^^^^^^^^^^
174+
The nomotion detection can detect when there is no motion for a certain amount of time. ::
175+
176+
libmetawear.mbl_mw_acc_start(board)
177+
libmetawear.mbl_mw_acc_bosch_set_no_motion_count(board, 5)
178+
libmetawear.mbl_mw_acc_bosch_set_no_motion_threshold(board, 144.0)
179+
libmetawear.mbl_mw_acc_bosch_write_motion_config(board, MBL_MW_ACC_BOSCH_MOTION_NOMOTION)
180+
no_motion = libmetawear.mbl_mw_acc_bosch_get_motion_data_signal(board)
181+
libmetawear.mbl_mw_datasignal_subscribe(no_motion, None, sensor_data_handler)
182+
libmetawear.mbl_mw_acc_bosch_enable_motion_detection(board, MBL_MW_ACC_BOSCH_MOTION_NOMOTION)
183+
184+
Detect Significant Motion
185+
^^^^^^^^^^^^^^^^^^^^^^^^^^
186+
The significant motion interrupt implements the interrupt required for motion detection in Android 4.3 and greater: https://source.android.com/devices/sensors/sensor-types.html#significant_motion.
187+
A significant motion is a motion due to a change in the user location.
188+
189+
Examples of such significant motions are walking or biking, sitting in a moving car, coach or train, etc.
190+
Examples of situations that does typically not trigger significant motion include phone in pocket and person is stationary or phone is at rest on a table which is in normal office use. . ::
191+
192+
libmetawear.mbl_mw_acc_start(board)
193+
libmetawear.mbl_mw_acc_bosch_set_sig_motion_blocksize(board, 250)
194+
libmetawear.mbl_mw_acc_bosch_write_motion_config(board, MBL_MW_ACC_BOSCH_MOTION_SIGMOTION)
195+
sig_motion = libmetawear.mbl_mw_acc_bosch_get_motion_data_signal(board)
196+
libmetawear.mbl_mw_datasignal_subscribe(sig_motion, None, sensor_data_handler)
197+
libmetawear.mbl_mw_acc_bosch_enable_motion_detection(board, MBL_MW_ACC_BOSCH_MOTION_SIGMOTION)
198+
82199
Step Counter
83200
------------
84201
The BMI160 accelerometer comes with a built in step counter. It has three operation modes that configure the sensitivity and robustness of the counter:
@@ -98,6 +215,8 @@ When you have set the operation mode, call
98215
libmetawear.mbl_mw_acc_bmi160_enable_step_counter(board)
99216
libmetawear.mbl_mw_acc_bmi160_write_step_counter_config(board)
100217

218+
The BMI270 accelerometer does not support step counter modes.
219+
101220
Reading The Counter
102221
^^^^^^^^^^^^^^^^^^^
103222
One way to retrieve step counts is to periodcally read the step counter. To read the step counter, call
@@ -111,6 +230,8 @@ The counter is not enabled by default so you will need enable it by calling
111230
libmetawear.mbl_mw_datasignal_subscribe(step_counter_signal, None, sensor_data_handler)
112231
libmetawear.mbl_mw_datasignal_read(step_counter_signal)
113232

233+
For the BMI270, you can call `mbl_mw_acc_bmi270_enable_step_counter <https://mbientlab.com/documents/metawear/cpp/latest/accelerometer__bosch_8h.html#a48e850d6bdb4b7084c735885465fc1c7>`_ when configuring the board.
234+
114235
Using The Detector
115236
^^^^^^^^^^^^^^^^^^
116237
Alternatively, you can receive notifications for each step detected by calling
@@ -119,14 +240,22 @@ Alternatively, you can receive notifications for each step detected by calling
119240
step_detector_signal= libmetawear.mbl_mw_acc_bmi160_get_step_detector_data_signal(board)
120241
libmetawear.mbl_mw_datasignal_subscribe(step_detector_signal, None, sensor_data_handler)
121242

243+
For the BMI270, the detector will not send notifications every step but instead every 20*X steps: ::
244+
245+
libmetawear.mbl_mw_acc_start(board)
246+
libmetawear.mbl_mw_acc_bmi270_set_step_counter_trigger(board, 1) //every 20 steps
247+
libmetawear.mbl_mw_acc_bmi270_write_step_counter_config(board)
248+
libmetawear.mbl_mw_acc_bmi270_reset_step_counter(board)
249+
detector = libmetawear.mbl_mw_acc_bmi270_get_step_detector_data_signal(board)
250+
libmetawear.mbl_mw_datasignal_subscribe(detector, None, sensor_data_handler)
251+
libmetawear.mbl_mw_acc_bmi270_enable_step_counter(board)
252+
122253
Orientation Detection
123254
---------------------
124255
The orientation detector alerts you when the sensor's orientation changes between portrait/landscape and front/back. Data is represented as an
125256
`MblMwSensorOrientation <https://mbientlab.com/docs/metawear/cpp/0/types_8h.html#a2e83167b55d36e1d48d100f342ad529c>`_ enum.
126257

127-
This feature is currently only supported on devices using the BMI160 or BMA255 accelerometers.
128-
129-
::
258+
This feature is currently only supported on devices using the BMI160 or BMA255 accelerometers. It is not supported on the BMI270. ::
130259

131260
orientation = libmetawear.mbl_mw_acc_bosch_get_orientation_detection_data_signal(board)
132261
libmetawear.mbl_mw_datasignal_subscribe(orientation, None, sensor_data_handler)

docs/source/conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,9 @@
5555
# built documents.
5656
#
5757
# The short X.Y version.
58-
version = '1.0.0'
58+
version = '1.0.1'
5959
# The full version, including alpha/beta/rc tags.
60-
release = '1.0.0'
60+
release = '1.0.1'
6161

6262
# The language for content autogenerated by Sphinx. Refer to documentation
6363
# for a list of supported languages.

docs/source/logging.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,16 @@ Once we are done logging, simply call: ::
1818

1919
libmetawear.mbl_mw_logging_stop(board)
2020

21+
Note for the MMS
22+
----------------
23+
The MMS (MetaMotionS) board uses NAND flash memory to store data on the device itself. The NAND memory stores data in pages that are 512 entries large. When data is retrieved, it is retrieved in page sized chunks.
24+
25+
Before doing a full download of the log memory on the MMS, the final set of data needs to be written to the NAND flash before it can be downloaded as a page. To do this, you must call the function: ::
26+
27+
libmetawear.mbl_mw_logging_flush_page(board)
28+
29+
This should not be called if you are still logging data.
30+
2131
Downloading Data
2232
----------------
2333
When you are ready to retrieve the data, execute

docs/source/settings.rst

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,3 +63,17 @@ A more detailed explanation of about BTLE connection parameters can be found on
6363
`post <https://devzone.nordicsemi.com/question/60/what-is-connection-parameters/>`_ from the Nordic Developer Zone forums. ::
6464

6565
libmetawear.mbl_mw_settings_set_connection_parameters(self.board, 750.0, 1000.0, 128, 16384)
66+
67+
MMS 3V Regulator
68+
---------------------
69+
The MMS (MetaMotion) board has a 3V regulator that can be turned on and off for IOs.
70+
71+
It is automatically turned on to power the coin vibration motor (if there is one attached), the ambient light sensor, and the LED.
72+
73+
However, if you have an external peripheral on the IOs that needs 3V power (such as a buzzer or UV sensor), you can use this function to turn on the power: ::
74+
75+
libmetawear.mbl_mw_settings_enable_3V_regulator(board, 1)
76+
77+
And to turn it off: ::
78+
79+
libmetawear.mbl_mw_settings_enable_3V_regulator(board, 0)

0 commit comments

Comments
 (0)