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

Microbit LED Strip Thermometer

Begin by creating a new Microbit project and adding the neopixel extension. Set up the LED strip and program the A button to display the temperature. Light up the LED lights according to the temperature, with more lights for higher temperatures. Download your project, connect your LED strip to your Microbit, and watch the LED strip light up according to the temperature.
Learning Goals Learning Outcomes Teacher Notes Lesson Files

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 - Create a new Microbit project

    To get started create a new Microbit project.

    makecode.microbit.org

    2 - 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.


    3 - 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.

    4 - Show the temperature

    Now let's program the A button to display the temperature on the screen of the Microbit.

    Add the following code to your project:

    5 - Light up the LED lights

    Finally let's display the temperature by lighting up the LED lights on the strip. The hotter it is the more lights we want to light up.

    We will use the show bar graph block and a temperature block to light up the LEDs on the strip according to what temperature the Microbit is reading from it's sensor. We will set the maximum temperature to be 30 degrees celsius (if it's 30 degrees then all the lights will light up).

    Add the following new code to your project:

    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