1 of 2

Positional Servo

​

Introduction

In this experiment we will be investigating how to control a positional servo that requires a 5V supply

​

​

�To enable the "set servo" blocks you will need to first load the "servo" extension by clicking on the add extensions menu

​

​

​

​

​

​

​

​

​

​

​

​

3b

1 Microbit

1 positional servo

breakout board

SG90

  1. First plug in the USB cable to send the code to the Microbit

2. After downloading the code, plug the USB into the breakout board to power the servo.

makecode.microbit.org

2 of 2

​

​

​

​

Coding Challenges

Challenge 1 - Point in random direction

Adapt your code to make the servo arm point in a random direction when you press the A button

​

Challenge 2 - A/B Control

Adapt your code so that when the A button is pressed the servo arm moves a bit to the left, when the B button pressed it moves a little to the right. When both A+B are press the arm returns to the middle.

​

​

​

Challenge 4 - Temperature meter

Adapt your code so that the servo arm acts as a temperature indicator arm. Lower temperatures it moves to the left, high temperatures it moves to the right.

​

​

​

7

3b