Microbit Arts
Intermediate
60 mins
Teacher/Student led
150 points
What you need:
Chromebook/Laptop/PC
Microbit
LED Strip with crocodile clips

LED Flags

In this step-by-step lesson, you'll learn how to create LED flags using a Microbit project. You'll start by making simple bicolor and tricolor flags, then progress to a more challenging task of coding the LED to represent the American flag. This lesson combines creativity with coding skills.
Learning Goals Learning Outcomes Teacher Notes

Live Class Feed

This is a live feed of the latest activity by your students on this lesson. It will update in real-time as they work on the lesson.
Load previous activity

    1 - Introduction

    Let's try make some flags using our LED strip. The easiest flags to make will be bicolor (2 colour) flags or tricolor (3 color) flags but we can get creative and make other ones as well.

    2 - Create a new Microbit project

    To get started create a new Microbit project.

    makecode.microbit.org

    3 - Add the neopixel extension

    To access the blocks we need to program the LED strip, you need to add the neopixel extension to your project.


    4 - Setup the LED Strip

    To be able to interact and program the LED strip we will need a variable that stores the strip.

    Add the following code to your project. We set the value to be 30 as there are 30 LEDs on the strip.

    5 - Make a bicolor flag

    To make a bicolor flag, we will create 2 ranges of LEDs on the strip and light them up the separate colours of the flag. In this example we're going to make the flag of Malta which is white and red.

    Create 2 ranges:

    • range1 - from 0 with 15 leds
    • range2 - from 15 with 15 leds

    And then light up range1 white and range2 red.

    Download the code to your microbit and attached the LED strip using the crocodile clips. It should light up as the flag of Malta.




    Unlock the Full Learning Experience

    Get ready to embark on an incredible learning journey! Get access to this lesson and hundreds more in our Digital Skills Curriculum.

    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