Welcome to Mini Microbit Handle repository
2.Button game
Button game
1. Learning goals
In this lesson, we will make a very simple micro:bit game. When we press the A button, the micro:bit dot matrix will display an arrow pointing to the A button; when we press the B button, the micro:bit will display an arrow pointing to the B button; if no button is pressed, the micro:bit It shows a heart.
2.Code and analysis
Note:
1 - The capital letter/lowercase letters must be distinguished!
2 - Correct spelling!
3 - Keywords such as # need a space between the content.
4 - You can only use the Tab key (tabulation key) for indentation.
3.Programming and downloading
3.1 You should open the Mu software, and enter the code in the edit window, as shown in figure .
Note! All English and symbols should be entered in English, and the last line must be a space.
3.2 As shown in Figure, you need to click the Check button to check if our code has an error. If a line appears with a cursor or an underscore, the program indicating this line is wrong.
3.3 You need to connect the micro data cable to micro:bit and the computer, then click the Flash button to download the program to micro:bit as shown in figure.
3.4 After the download is successful, we can see that the micro:bit shows a heart,as shown in Figure 1.When we press the A button, the micro:bit dot matrix will display an arrow pointing to the A button, as shown in Figure 2; when we press the B button, the micro:bit will display an arrow pointing to the B button,as shown in Figure 3.

Figure 1 Figure 2

Figure 3