Coding Ireland STEM Report 2024 Have Your Say
Game Microbit
30 mins
135 points
What you need:
  • Computer/laptop
  • Microbit


Is our Microbit happy or sad? In this lesson we make it show lots of different faces.

1 - Create a new Microbit project

Go to the website and start a new Microbit project.

2 - Show the asleep face

In this lesson we're going to make our Microbits show different faces. At start let's show the asleep face, add the following code.


3 - Make it happy

Now let's program the A button to make our Microbit happy by showing the happy face. Add the following code.

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

4 - Make it sad

Now let's program the B button to make our Microbit sad by showing the sad face. Add the following code.

input.onButtonPressed(Button.B, function () {

5 - Make it meh

The meh face is not quite happy and not quite sad, just kind of in between! Add the following code.

input.onButtonPressed(Button.AB, function () {

Join our club 😃

To view the remaining 5 steps and access hundreds of other coding projects please login or create an account.

Copyright Notice
This lesson is copyright of Coding Ireland. Unauthorised use, copying or distribution is not allowed.
🍪 Our website uses cookies to make your browsing experience better. By using our website you agree to our use of cookies. Learn more