@@ -40,11 +40,15 @@ speed. Units:
4040accel: Typically G. Values are normalised in the algorithm so units are irrelevant.
4141gyro: Degrees per second.
4242
43- ``` calibrate(getxyz, stopfunc) ```
43+ ``` calibrate(getxyz, stopfunc, waitfunc ) ```
4444
4545The first argument is a function returning a tuple of magnetic x,y,z values from the sensor.
4646The second is a function returning ``` True ``` when calibration is deemed complete: this could
47- be a timer or an input from the user. The method updates the ``` magbias ``` property.
47+ be a timer or an input from the user.
48+ The third is a function providing a delay. Some hardware may require a delay between magnetometer
49+ readings. In multi-threaded environments the function provides an opportunity to yield
50+ execution to other threads.
51+ The method updates the ``` magbias ``` property.
4852
4953Calibration is performed by rotating the unit around each orthogonal axis while the routine
5054runs, the aim being to compensate for offsets caused by static local magnetic fields.
@@ -77,7 +81,7 @@ these will be aliased down into the filter passband and affect the results. It's
7781neccessary to isolate the sensor with a mechanical filter, typically a mass supported on very
7882soft rubber mounts.
7983
80- If using a magnetoemeter consider the fact that the Earth's magnetic field is small: the field
84+ If using a magnetometer consider the fact that the Earth's magnetic field is small: the field
8185detected may be influenced by ferrous metals in the machine being controlled or by currents in
8286nearby wires. If the latter are variable there is little chance of compensating for them, but
8387constant magnetic offsets may be addressed by calibration. This involves rotating the machine
0 commit comments