pxt-calliope/docs/reference/input/calibrate-compass.md
Sam El-Husseini e3975e65e5 pxt-microbit Accessibility PR (#529)
* Accessibility changes
2017-09-07 13:42:08 -07:00

520 B

Calibrate Compass

Runs the compass calibration sequence.

input.calibrateCompass();

Calibration

The calibration will ask you to draw a circle by tilting the @boardname@.

If you are calibrating or using the compass near metal, it might confuse the @boardname@.

Example

This example runs the calibration when the user presses A+B buttons.

input.onButtonPressed(Button.AB, () => {
    input.calibrateCompass();
})

See also

compassHeading