Skip to content

How to build a robot lesson 2 - Microbit buttons

Why
To build a robot with legos, you will need to learn how to create programs that can react to external events that affect the microbit.
What
In this lesson you will learn how to create a program for the Microbit that reacts to a button being pressed.
How
You will create a program in Microsoft Makecode that utilizes button pressing events.
The Lesson

What you will need for this activity:
1. A laptop, desktop, or chromebook
2. An internet connection
3. A Microbit v2
4. USB cable to connect microbit to
computer

 

Instructions

1. Open https://www.microsoft.com/en-us/makecode in a web
browser
2. Sign in with your free account by clicking the Sign in in the
top right of the screen
3. After signing in, click on the picture of the micro:bit, this
should take you to https://makecode.microbit.org/
4. Click on the purple New Project rectangle image to create a
new project
5. Enter “press me” for the name of your project, then
click the green Create button.

Take the Challenge

Get the Coding Challenge Worksheet for Lesson 2

Practice coding, signup for the free challenge worksheet.

    We respect your privacy. Unsubscribe at any time.
    The Solution

    If you get stuck on the challenge, you can request the solution guide by filling out this form.

    Review

    In this lesson you learned how code microbit to react when one of its buttons is pressed.

    Ask Your Question

    Do you need help or have a question?