Skip to content


Calming LEDs

Beginner | MakeCode, Python | LED display | 3 Health, Animation, Iteration, Sequence

Step 1: Make it

What is it?

Turn your micro:bit into a simple digital device to help you relax by slowing and regulating your breathing using a simple animation sequence.

This project is part of a series created to offer problem-solving and prototyping activities designed to explore technology as a solution to the challenges of the Global Goals for Sustainable Development.


Coding guide

How it works

  • Build an animation sequence in a 'forever' loop to keep it running.
  • Use the large and small built-in diamond icons to create a pulsating effect.
  • Add pause blocks to slow down the animation to a relaxing pace.
  • Use a longer pause in the middle of the animation, perhaps 2 seconds which is 2000 milliseconds.
  • Test out your code in the MakeCode simulator to make sure it works the way you want before transferring it to your micro:bit.

What you need

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

Step 2: Code it

1from microbit import *
3while True:
4    sleep(2000)
6                       '00000:'
7                       '00900:'
8                       '00000:'
9                       '00000'))
10    sleep(500)
12    sleep(500)
14    sleep(2000)
16    sleep(500)
18                       '00000:'
19                       '00900:'
20                       '00000:'
21                       '00000'))

Step 3: Improve it

  • Change the pause times to match your own preferred pace of breathing.
  • Create your own images to replace the diamond icons.
  • Add more steps to make your animation smoother.