Skip to content

Class hal::magnetometer

ClassList > hal > magnetometer

Magnetic field strength sensing hardware abstraction interface. More...

  • #include <magnetometer.hpp>

Inherited by the following classes: hal::soft::inert_magnetometer

Classes

Type Name
struct read_t
Result from reading the accelerometer.

Public Functions

Type Name
result< read_t > read ()
Read the latest magnetic field strength sensed by the device.
virtual ~magnetometer () = default

Detailed Description

Magnetometers are usually used for determining the strength of a magnetic field, or calculating compass headings. If the device that the magnetometer is mounted on, tends to move, or change its own orientation, then it is helpful to use an accelerometer or tilt sensor in order to determine appropriate heading for compass calculations.

Public Functions Documentation

function read

Read the latest magnetic field strength sensed by the device.

inline result< read_t > hal::magnetometer::read () 

Returns:

result<read_t> - magnetic field strength data

function ~magnetometer

virtual hal::magnetometer::~magnetometer () = default

The documentation for this class was generated from the following file libraries/include/libhal/magnetometer.hpp