Pi Supply bit:buggy Project 02 – Make a Shape

In the last project we showed you how to move the bit:buggy forward and backwards, whilst familiarising yourself with Microsoft Make Code programming language. In this project we are going to show you how to make turns left and right by turning each servo motor either on or off.

Connect your hardware

If you haven’t done so already, you will need to connect the left servo wheel to P1 and the right servo wheel to P2.

Coding

Step 1 –  Snap into place the “set left wheel at P1 right wheel at P2” block into the “On start” block. The port number is the actual servo connection port.

Step 2 – With the “Forever” block snap in the following code blocks:

  • go straight at full speed
  • pause
  • turn right at full speed
  • pause

Step 4 – Upload your code to the bit:buggy

Program

Here is the program link – https://makecode.microbit.org/_hHL6ToXRy7rt

 Action

After you have uploaded the sketch you should see the micro:bit buggy slowly turn on a full circle in a clockwise direction creating the shape of a circle.

Taking it further

Can you make any other shapes with the bit:buggy?

Project Examples

 

First published at 6:43pm on September 29, 2019
Last updated at 12:07pm on December 12, 2019