17 mag = Adafruit_MMC5603(address);
21 mag.setContinuousMode(
true);
57 const float kSurfaceField = 6619.0;
58 const float kBrmax = 14800.0;
59 const float kBHmax = 52.0;
67 float fieldStrength = (kSurfaceField * (kBrmax / sqrtf(kBrmax * kBrmax + distance * distance * 4.0f))) * (kBHmax / sqrtf(kBHmax * kBHmax + distance * distance * 4.0f)) * 8.0f;
A class for interfacing with the Adafruit MMC56x3 magnetometer sensor.
static Vector3D EstimateMagnetPosition()
Estimates the position of a detected magnet.
static float minimum
Minimum threshold for detection.
static MinFilter< 10 > minF
Minimum filter for noise reduction.
static Vector3D GetMagneticField()
Retrieves the current magnetic field vector.
static RunningAverageFilter< 10 > xFilter
Filter for the X-axis magnetic field data.
static bool Initialize(uint8_t address=MMC56X3_DEFAULT_ADDRESS)
Initializes the MMC56x3 sensor.
static TimeStep timeStepCal
Time utility for calibration intervals.
static TimeStep timeStep
Time utility for regular updates.
static sensors_event_t magEvent
Sensor event data for magnetic field measurements.
static Adafruit_MMC5603 mag
Instance of the Adafruit MMC5603 sensor.
static float GetMagnitude()
Calculates the magnitude of the magnetic field.
static float IsDetected()
Checks if a magnet is detected.
static RunningAverageFilter< 10 > yFilter
Filter for the Y-axis magnetic field data.
static bool didBegin
Flag indicating if the sensor has been initialized.
static void Update()
Updates the magnetic field data from the sensor.
static RunningAverageFilter< 10 > zFilter
Filter for the Z-axis magnetic field data.
static Vector3D magneticField
Processed magnetic field vector.
Implements a minimum filter over a sliding window.
float Filter(float value)
Filters the given value, updating the minimum value within the memory window.
Smooths data values using a weighted running average.
float Filter(float value)
Filters the input value using the running average.
Provides a mechanism to trigger actions at a specified frequency.
bool IsReady()
Checks if the specified time interval has elapsed.
Represents a 3D vector (X, Y, Z) and provides methods for vector arithmetic.
float Z
The Z-component of the 3D vector.
float X
The X-component of the 3D vector.
float Y
The Y-component of the 3D vector.