Skip to content

MagnetometerReadingEvent

Inherits: Event['Magnetometer']

A sensor sample from a magnetometer.

Magnetometers measure the ambient magnetic field surrounding the sensor, returning values in microteslas μT for each three-dimensional axis.

Consider that these samples may bear effects of Earth's magnetic field as well as local factors such as the metal of the device itself or nearby magnets, though most devices compensate for these factors.

A compass is an example of a general utility for magnetometer data.

Properties

  • timestamp(int) –

    Event timestamp, expressed in microseconds since epoch.

  • x(float) –

    Ambient magnetic field on the X axis, in microteslas (uT).

  • y(float) –

    Ambient magnetic field on the Y axis, in uT.

  • z(float) –

    Ambient magnetic field on the Z axis, in uT.

Properties#

timestamp instance-attribute #

timestamp: int

Event timestamp, expressed in microseconds since epoch.

x instance-attribute #

x: float

Ambient magnetic field on the X axis, in microteslas (uT).

y instance-attribute #

y: float

Ambient magnetic field on the Y axis, in uT.

z instance-attribute #

z: float

Ambient magnetic field on the Z axis, in uT.