Activity

7 steps

ステップ 1

Drag an on button pressed block into the workspace; this will run code when button A is pressed.

input.onButtonPressed(Button.A, function () {
})

ステップ 2

Place a show leds block inside the on button pressed block to display a smiley on the screen when A is pressed. Click the squares so they are filled white; this represents an 'on' LED. Use this to draw a face.

ステップ 5

Click Download to transfer your code in your micro:bit and try pressing button A or B.

Step Six

Add a secret mode where A and B are pressed together (drag another 'on button pressed' block and click the arrow next to 'A' to change to 'A+B'). In that case, add multiple show leds blocks to create an animation...