8. Case 06: Compass

8.1. Purpose

  • Use the Smart Coding Kit to create a wearable compass.

8.2. Materials

  • 1 x smart coding kit

8.3. Software


8.4. Programming

  • Save the returned value of the compass direction as varible i and judge it, if i<45 or i>315, display “N”; if i<135, display “E”; if i<225, display “S”, or display “W”.


8.5. Result

The current direction displays on the micro:bit.

8.6. Exploration

8.7. FAQ

8.8. Relevant File