Download presentation
Presentation is loading. Please wait.
1
BBC Microbit
2
Objective of the lesson
Use Block Editor to make a Compass All of you will: Make an arrow change direction as you move the Microbit Most of you will: Change the compass display message Some of you will: Add in extra directions NE, SE, SW, NW
3
Compass The compass on the Microbit can detect which direction it is facing North (N) is 0 degrees North East (NW) is 45 degrees East (N) is 90 degrees South East (SE) is 135 degrees South (N) is 180 degrees South West (SE) is 225 degrees West (W) is 270 degrees North West (SE) is 315 degrees
4
Add a ‘forever’ loop Add a variable. Call it degrees and set it to equal the compass heading We will just display the four main directions Add if, else if and else statements. Use the less than < to display the compass direction. We use cut off points of North East (NW) is 45 degrees South East (SE) is 135 degrees South West (SE) is 225 degrees North West (SE) is 315 degrees
6
Challenge Change the program so that it displays North, East, South, West instead of N, E, S, W Use the number of degrees of a 16 point compass to include NE, SE, SW, NW
7
Answers
Similar presentations
© 2024 SlidePlayer.com Inc.
All rights reserved.