Initialize a list of directions ["N", "S", "E", "W"]
Loop Forever:
Randomly select a direction from the list
If the direction is "N":
Display an upward arrow
Else if the direction is "S":
Display a downward arrow
Else if the direction is "E":
Display a rightward arrow
Else if the direction is "W":
Display a leftward arrow
Wait for 1 second
If direction is "N" and accelerometer detects tilt upwards:
Display a happy face
Else if direction is "S" and accelerometer detects tilt downwards:
Display a happy face
Else if direction is "E" and accelerometer detects tilt to the right:
Display a happy face
Else if direction is "W" and accelerometer detects tilt to the left:
Display a happy face
Else:
Display a sad face
Wait for 2 seconds
Clear the display
Purpose: You will be using the Micro:bit physical Hardware. In this lesson, you will write a Python program to run on the micro:bit that will learn the Microbit Hardware. Your video will be of the actual Micro:Bit hardware. You will drop off 5 files into Google Classroom: • Your files will be: (Remember the python program is dropped off first.) • PX_lastname_Direction.py (Python program) • PX_lastname_Direction.hex (Hex file for Microbit hardware) • PX_lastname_Direction.png (Screenshot) • PX_lastname_Direction.mp4 (Video running the program) • PX_lastname_Direction.mp4 (Video running the program on the micro:bit Hardware) Current Resources needed: Check in and check out your Micro:Bit Launch the Micro:Bit Python interpreter At this time you will run your code. Use the online Microbit but still download the hex file for hardware use. If you do not understand this assignment, ask Mr. Cusack and/or attend tutorials.