2017-05-31 13:05:43 +08:00
|
|
|
.. _bmm150:
|
|
|
|
|
2017-10-18 00:46:49 +08:00
|
|
|
BMM150 Geomagnetic Sensor
|
2017-05-31 13:05:43 +08:00
|
|
|
#########################
|
|
|
|
|
|
|
|
Overview
|
|
|
|
********
|
|
|
|
|
|
|
|
This sample application periodically reads magnetometer (X, Y, Z) data from
|
|
|
|
the first available device that implements SENSOR_CHAN_MAGN_* (predefined array
|
|
|
|
of device names). This sample checks the sensor in polling mode (without
|
|
|
|
interrupt trigger).
|
|
|
|
|
|
|
|
Building and Running
|
|
|
|
********************
|
|
|
|
|
2019-06-13 20:31:56 +08:00
|
|
|
This sample application uses an BMM150 sensor connected to a board via I2C.
|
2017-05-31 13:05:43 +08:00
|
|
|
Sensor has multiple pins so you need to connect according to connection diagram given in
|
|
|
|
`bmm150 datasheet`_ at page 41.
|
|
|
|
|
|
|
|
.. code-block:: console
|
|
|
|
|
2017-11-12 17:13:52 +08:00
|
|
|
.. zephyr-app-commands::
|
|
|
|
:zephyr-app: samples/sensors/bmm150
|
2019-06-13 20:31:56 +08:00
|
|
|
:board: nrf52840_pca10056
|
2017-11-12 17:13:52 +08:00
|
|
|
:goals: flash
|
|
|
|
:compact:
|
2017-05-31 13:05:43 +08:00
|
|
|
|
|
|
|
Sample Output
|
|
|
|
=============
|
|
|
|
To check output of this sample , any serial console program can be used.
|
|
|
|
Here I am using picocom program to open output. Check which tty device it is.
|
2019-06-13 20:31:56 +08:00
|
|
|
In my case it is ttyACM0
|
2017-05-31 13:05:43 +08:00
|
|
|
|
|
|
|
.. code-block:: console
|
|
|
|
|
2019-06-13 20:31:56 +08:00
|
|
|
$ sudo picocom -D /dev/ttyACM0
|
2017-05-31 13:05:43 +08:00
|
|
|
|
|
|
|
.. code-block:: console
|
|
|
|
|
|
|
|
( x y z ) = ( -0.390625 0.087500 -0.390625 )
|
|
|
|
( x y z ) = ( -0.275000 0.115625 -0.275000 )
|
|
|
|
( x y z ) = ( -0.281250 0.125000 -0.281250 )
|
|
|
|
( x y z ) = ( -0.287500 0.134375 -0.287500 )
|
|
|
|
|
|
|
|
.. _bmm150 datasheet: http://www.mouser.com/ds/2/783/BST-BMM150-DS001-01-786480.pdf
|