Magnetometer

Periodically read magnetometer sensor data and display on a ZentriOS terminal.

API Features Demonstrated

Platforms

This app works on:

Requirements and Prerequisites

This app requires a ZentriOS device, such as an AMWx06-E03 (Moray), connected via the I2C interface to a MPU-9250 gyroscope sensor from Invensense.

Description

Periodically read magnetometer sensor data and display on a ZentriOS terminal.

Usage Instructions

See Connecting a Zentri AMW106 to an InvenSense MPU-9250.

Open a ZentriOS serial terminal to the device. See Getting Started, Opening a ZentriOS Terminal.

Build, download and run the app. It displays a message similar to the following on the ZentriOS terminal:

Starting Magnetometer App
Initialisation successful!
Getting data....
X: -27 uT
Y: -1 uT
Z: -90 uT
Getting data....
X: -28 uT
Y: -1 uT
Z: -89 uT
Getting data....
X: -28 uT
Y: -2 uT
Z: -90 uT

where X/Y/Z values reflect periodic sensor readings.

Implementation

zn_app_init()

read_mag_data()

Source

See: