1 of 20

Let’s get physical! Programming LEDs and Servos with your micro:bit

2 of 20

What's all this stuff?

3 of 20

Let’s Jump in!

Go to:

Makecode.microbit.org

4 of 20

Code for LED (light emitting diode)

5 of 20

When connecting LEDs to your micro:bit:

  1. Always connect ground (GND) first.
  2. Then connect to your chosen pin.

6 of 20

micro:bit LED setup

Full LED Board:

Single LED:

7 of 20

LED Challenge #1

Try changing this number to 700 and see what happens. What about 500? 200?

8 of 20

LED Challenge #2

Experiment with these two blocks: what is the difference between analog and digital?

9 of 20

LED Challenge #3: Make the light blink

10 of 20

LED Challenge #4

Have the LED turn ON when Button A is pushed and turn OFF when Button B is pushed.

11 of 20

Programming a servo to move!

12 of 20

Micro:bit and Servo Setup

You will need:

-1 Servo

-3 Pigtail alligator clips

13 of 20

What do the colors on the servo wires mean?

Black = Ground

Red = 3 V/Power

White = Pin #/Control Signal

14 of 20

1. Connect the pins to the servo

2. Connect the alligator clips to the micro:bit

-Black to ground

-Red to 3V

-White to Pin (does it matter which pin you connect it to?)

15 of 20

How to: micro:bit & servo

16 of 20

Now let’s create something!

17 of 20

Now let’s create something!

Use a servo and an LED!

18 of 20

19 of 20

Now let’s create something!

20 of 20

THANK YOU.