Get single magnetometer value
  • 18 May 2022
  • 1 Minute to read
  • Dark
    Light
  • PDF

Get single magnetometer value

  • Dark
    Light
  • PDF

Article Summary

Get a single reading from the device magnetometer. By default, updates sensorVars.magnetometer.latestValue and sensorVars.magnetometer.values.

Input arguments

LabelKeyTypeRequired?DefaultDescription
Update sensor variablesupdateSensorVarsBooleanYestrueIf true, the new value will also be stored into sensorVars.magentometer.latestValue and sensorVars.magentometer.values.

Output arguments

Number of outputs: 2

LabelKeyTypeDescription
Magnetometer valuevalueObjectValue of the device magnetometer when the flow function was called.
  • X field
value.xNumberMagnetic field of the device along its X axis, in microteslas.
  • Y field
value.yNumberMagnetic field of the device along its Y axis, in microteslas.
  • Z velocity
value.zNumberMagnetic field of the device along its Z axis, in microteslas.
  • timestamp
value.timestampStringISO 8601 timestamp of when the value was read.

Events

No events.

Errors

LabelCodeDescription
Unknown errorunknownThrown when calling the native API resulted in an unknown error.

Was this article helpful?

What's Next