Skip to content

Commit 0082b6e

Browse files
author
Faris Chebib
committed
cleaning up the compass / direction docs
1 parent d533010 commit 0082b6e

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

docs/tutorials/direction.rst

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,16 @@ It can also tell you the direction of North like this::
1717
needle = ((15 - compass.heading()) // 30) % 12
1818
display.show(Image.ALL_CLOCKS[needle])
1919

20-
**You must calibrate the compass before taking readings.** Failure to do so
21-
will just produce garbage results. The ``calibration`` method runs a fun little
22-
game to help the device work out where it is in relation to the Earth's
23-
magnetic field.
20+
.. note::
21+
22+
**You must calibrate the compass before taking readings.** Failure to do so
23+
will produce garbage results. The ``calibration`` method runs a fun little
24+
game to help the device work out where it is in relation to the Earth's
25+
magnetic field.
26+
27+
To calibrate the compass, tilt the micro:bit around until a circle of pixels is
28+
drawn on the outside edges of the display.
2429

2530
The program takes the ``compass.heading`` and, using some simple yet
26-
cunning maths (floor division ``//`` and modulo ``%`` ~ look up what these
27-
mean), works out the number of the clock hand to use to display on the screen
31+
cunning maths, `floor division <https://en.wikipedia.org/wiki/Floor_and_ceiling_functions>`_ ``//`` and `modulo <https://en.wikipedia.org/wiki/Modulo_operation>`_ ``%``, works out the number of the clock hand to use to display on the screen
2832
so that it is pointing roughly North.

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy