Intermediate
60 mins
Teacher/Student led
+85 XP

Micro:bit Responds to an Input

Learn to program a micro:bit to notice sensor inputs such as a shake or tilt without pressing buttons. Build and test your code, fix any bugs discovered and think of one way to improve the response.

Teacher Class Feed

Load previous activity

    1 - Getting Started ~5 mins

    Illustration for Getting StartedYou already know how a button press can make a micro:bit show something on its lights. Today the board will notice something for itself, with no button.

    Hands up: if the micro:bit could react without a button, what should set it off, a shake, a tilt, or a sound?

    2 - From Button to Sensor ~7 mins

    Key point

    A sensor input means the board notices something on its own, a shake, a tilt, or a sound, without anyone pressing a button.

    Key point

    Every short program on the board has three parts: input (what comes in), process (what the program does with it), and output (what the lights do next).

    If we shake the micro:bit, what should it do, and what are those three parts?

    3 - Watch the Model ~8 mins

    Watch the board. We will write one short program so the micro:bit reacts when it is shaken and shows a happy face. Before we run it, predict: what will you see on the LEDs when it is shaken?

    4 - Program, Test and Debug ~25 mins

    With your partner, build the shake program on the board steps: when the micro:bit is shaken, it shows your chosen icon. Run it and trigger the shake several times.

    Key point

    Find and fix at least one bug. If it works first time, change one block on purpose, swap boards with another pair, and find that bug.

    Key point

    Be ready to say out loud: the input was…, the output was…, the bug was…

    5 - Record in Your Journal ~8 mins

    On your Investigation Journal page, record what you built. Use these starters if you need them:

    Input was… Output was… Bug was… We fixed it by… (or: We broke… on purpose and our partners found…)

    Next we would…

    Pupil practice · Investigation Journal
    Module 4 · Technology: Inputs, Algorithms and Coding on Devices
    Lesson 28 · Micro:bit Responds to an Input
    123learn · Online learning platform

    Unlock the full learning experience

    You're previewing this lesson. Get full access to this lesson and hundreds more — each one ready to teach, with interactive activities, printable resources and pupil progress tracking built in.

    Hundreds of curriculum-aligned lessons
    Interactive activities in every lesson
    Printable resources & progress tracking
    Copyright Notice
    This lesson is copyright of Coding Ireland 2017 - 2025. 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