Skip to content

Activity

Calming LEDs

Beginner | MakeCode, Python | LED display | 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.

Introduction

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

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.