![]() |
ProtoTracer
1.0
Real-time 3D rendering and animation engine
|
A class for managing the Adafruit MMC56x3 magnetometer sensor. More...
#include <MMC56X3.h>
Static Public Member Functions | |
static bool | Initialize (uint8_t address=MMC56X3_DEFAULT_ADDRESS) |
Initializes the MMC56x3 sensor. | |
static void | Update () |
Updates the magnetic field data from the sensor. | |
static Vector3D | GetMagneticField () |
Retrieves the current magnetic field vector. | |
static float | IsDetected () |
Checks if a magnet is detected. | |
static float | GetMagnitude () |
Calculates the magnitude of the magnetic field. | |
static Vector3D | EstimateMagnetPosition () |
Estimates the position of a detected magnet. | |
Static Private Attributes | |
static Adafruit_MMC5603 | mag |
Instance of the Adafruit MMC5603 sensor. | |
static sensors_event_t | magEvent |
Sensor event data for magnetic field measurements. | |
static RunningAverageFilter< 10 > | xFilter = RunningAverageFilter<10>(0.1f) |
Filter for the X-axis magnetic field data. | |
static RunningAverageFilter< 10 > | yFilter = RunningAverageFilter<10>(0.1f) |
Filter for the Y-axis magnetic field data. | |
static RunningAverageFilter< 10 > | zFilter = RunningAverageFilter<10>(0.1f) |
Filter for the Z-axis magnetic field data. | |
static TimeStep | timeStep = TimeStep(100) |
Time utility for regular updates. | |
static TimeStep | timeStepCal = TimeStep(1) |
Time utility for calibration intervals. | |
static Vector3D | magneticField = Vector3D() |
Processed magnetic field vector. | |
static bool | didBegin = false |
Flag indicating if the sensor has been initialized. | |
static MinFilter< 10 > | minF = MinFilter<10>(false) |
Minimum filter for noise reduction. | |
static float | minimum = 0.0f |
Minimum threshold for detection. | |
A class for managing the Adafruit MMC56x3 magnetometer sensor.
The MMC56X3 class provides methods for initializing the sensor, retrieving magnetic field data, detecting magnets, and estimating magnet positions.
|
static |
Estimates the position of a detected magnet.
Definition at line 56 of file MMC56X3.cpp.
References GetMagnitude(), magneticField, Update(), Vector3D::X, Vector3D::Y, and Vector3D::Z.
|
static |
Retrieves the current magnetic field vector.
Definition at line 43 of file MMC56X3.cpp.
References magneticField, and Update().
|
static |
Calculates the magnitude of the magnetic field.
Definition at line 52 of file MMC56X3.cpp.
References magneticField, Vector3D::X, Vector3D::Y, and Vector3D::Z.
Referenced by EstimateMagnetPosition(), IsDetected(), and Update().
|
static |
Initializes the MMC56x3 sensor.
address | The I2C address of the sensor (default is MMC56X3_DEFAULT_ADDRESS). |
Definition at line 15 of file MMC56X3.cpp.
|
static |
Checks if a magnet is detected.
Definition at line 48 of file MMC56X3.cpp.
References GetMagnitude(), and minimum.
|
static |
Updates the magnetic field data from the sensor.
Definition at line 25 of file MMC56X3.cpp.
References didBegin, MinFilter< memory >::Filter(), RunningAverageFilter< memory >::Filter(), GetMagnitude(), TimeStep::IsReady(), mag, magEvent, magneticField, minF, minimum, timeStep, timeStepCal, Vector3D::X, xFilter, Vector3D::Y, yFilter, Vector3D::Z, and zFilter.
Referenced by EstimateMagnetPosition(), and GetMagneticField().
Flag indicating if the sensor has been initialized.
Definition at line 39 of file MMC56X3.h.
Referenced by Initialize(), and Update().
|
staticprivate |
Instance of the Adafruit MMC5603 sensor.
Definition at line 31 of file MMC56X3.h.
Referenced by Initialize(), and Update().
|
staticprivate |
Processed magnetic field vector.
Definition at line 38 of file MMC56X3.h.
Referenced by EstimateMagnetPosition(), GetMagneticField(), GetMagnitude(), and Update().
|
staticprivate |
Minimum threshold for detection.
Definition at line 41 of file MMC56X3.h.
Referenced by IsDetected(), and Update().
|
staticprivate |
|
staticprivate |
|
staticprivate |