readMagneticField
Read one sample of magnetic field from sensor
Description
[
returns one sample of the magnetic field data on x, y, and z axes read from the
sensor in units of µT (microtesla) along with the magReadings,timestamp] = readMagneticField(sensorobj)timestamp.
Timestamp is optional.
Note
The
readMagneticFieldfunction is available for theMPU9250,LSM9DS1,LSM303C, andICM20948sensors.To generate C/C++ code for this function, you must have an Embedded Coder® license.
Examples
Input Arguments
Output Arguments
Extended Capabilities
Version History
Introduced in R2021a