fsdfds
Dependencies: BLE_API mbed-dev-bin nRF51822
Fork of microbit-dal by
MicroBitCompassCalibrator Class Reference
Class definition for an interactive compass calibration algorithm. More...
#include <MicroBitCompassCalibrator.h>
Public Member Functions | |
MicroBitCompassCalibrator (MicroBitCompass &_compass, MicroBitAccelerometer &_accelerometer, MicroBitDisplay &_display) | |
Constructor. | |
void | calibrate (MicroBitEvent) |
Performs a simple game that in parallel, calibrates the compass. |
Detailed Description
Class definition for an interactive compass calibration algorithm.
The algorithm uses an accelerometer to ensure that a broad range of sample data has been gathered from the compass module, then performs a least mean squares optimisation of the results to determine the calibration data for the compass.
The LED matrix display is used to provide feedback to the user on the gestures required.
This class listens for calibration requests from the compass (on the default event model), and automatically initiates a calibration sequence as necessary.
Definition at line 47 of file MicroBitCompassCalibrator.h.
Constructor & Destructor Documentation
MicroBitCompassCalibrator | ( | MicroBitCompass & | _compass, |
MicroBitAccelerometer & | _accelerometer, | ||
MicroBitDisplay & | _display | ||
) |
Constructor.
Create an object capable of calibrating the compass.
The algorithm uses an accelerometer to ensure that a broad range of sample data has been gathered from the compass module, then performs a least mean squares optimisation of the results to determine the calibration data for the compass.
The LED matrix display is used to provide feedback to the user on the gestures required.
- Parameters:
-
compass The compass instance to calibrate. accelerometer The accelerometer to gather contextual data from. display The LED matrix to display user feedback on.
Definition at line 48 of file MicroBitCompassCalibrator.cpp.
Member Function Documentation
void calibrate | ( | MicroBitEvent | ) |
Performs a simple game that in parallel, calibrates the compass.
This function is executed automatically when the user requests a compass bearing, and compass calibration is required.
This function is, by design, synchronous and only returns once calibration is complete.
Definition at line 61 of file MicroBitCompassCalibrator.cpp.
Generated on Wed Jul 13 2022 00:58:04 by 1.7.2