Skip to content

Activity

Emotion badge

Beginner | MakeCode, Python | Buttons, LED display | 4 Quality education, Abstraction, Input/output

Step 1: Make it

What is it?

Use your micro:bit to tell the world how you’re feeling.

These two videos show you what you'll make and how to code it:

Introduction

Coding guide

How it works

  • The micro:bit has two input buttons on the front you can use to make things happen.
  • When you press input button A the program reacts by showing a happy face image on the LED display output.
  • Pressing button B makes a sad face appear.

What you need

  • micro:bit (or MakeCode simulator)
  • MakeCode or Python editor
  • battery pack (optional)

Step 2: Code it

1from microbit import *
2
3while True:
4    if button_a.is_pressed():
5        display.show(Image.HAPPY)
6    if button_b.is_pressed():
7        display.show(Image.SAD)

Step 3: Improve it

  • Try other emotion images such as ASLEEP, CONFUSED or MEH.
  • Design your own 'emoticons' using the LED display.
  • Use the badge to show if you need help or make class voting badges with ticks or crosses.
  • Design a way of wearing your micro:bit badge using thread, or tape. (Don't use safety pins as the metal could damage your micro:bit.)
  • Make the project more accessible by adding cardboard to make the buttons easier to press.
A micro:bit held on a strip of cardboard with 2 rubber bands. The cardboard is folded over at each side to make large flaps labelled A and B to press each button.