MakeCode Guide

Roversa allows students to progress from simple computer science concepts like sequences and directional language to more advanced concepts in a unified environment. You can use the MakeCode extension to introduce students to more advanced computer science concepts like loops, conditions and variables, as they reprogram the buttons on Roversa.

Be sure to check out the Challenge Cards for video tutorials for all the steps below!

Challenge Cards ►

Add the Roversa extension

The MakeCode toolbox with Math and Extensions

Open the MakeCode Editor and select Extensions from the menu.

The extension search box with roversa typed in

Type roversa into the search box.

The roversa-2 extension card: PXT extension for Roversa in MakeCode

Select the roversa extension.

Roversa blocks

With the Roversa blocks you can update what any of the buttons do.

The MakeCode toolbox with the Roversa category open, showing button blocks and basic drive and turn blocks

Button blocks

Use these blocks to reprogram the buttons on Roversa.

The Roversa button blocks: Roversa button Menu is pressed, and Roversa button on Menu click

Button on

The LED screen updates when the Forward arrow button is clicked. Choose when the code runs:

  • click: with a single click of the button
  • down: when the button is pressed down
  • up: after the button is pressed and comes back up

A Roversa button on Forward click block containing a show icon block

Is pressed

The LED screen updates if the Forward arrow button is pressed. Put conditional (if) blocks like this inside a forever loop, so the program keeps checking the button.

A forever block containing: if Roversa button Forward is pressed then show icon

Servo blocks

There are two sets of blocks to control the servos: basic and advanced.

Basic

  • drive forward: drives forward the default distance, then stops
  • drive backward: drives backward the default distance, then stops
  • turn right: turns right 90 degrees, then stops
  • turn left: turns left 90 degrees, then stops

The basic servo blocks: drive forward, drive backward, turn left, turn right

Advanced

  • drive forwards: drives forward the distance you set (in millimeters), then stops
  • drive backwards: drives backward the distance you set (in millimeters), then stops
  • turn right: turns right the degrees you set, then stops
  • turn left: turns left the degrees you set, then stops
  • stop: stops the servos

The advanced servo blocks: drive forwards 0 distance, drive backwards 0 distance, turn right 90 degrees, turn left 90 degrees, stop

Every Roversa is unique. If your Roversa is not moving as expected, you can tune it.

Loop example

This code makes the Forward arrow button move Roversa in a square.

A Roversa button on Forward down block containing drive forward and turn right four times

The repeat block does the same thing with fewer blocks: it loops “drive forward” and “turn right” four times.

A Roversa button on Forward down block containing repeat 4 times: drive forward, turn right

Download your code

With Bluetooth

  1. Click the 3 dots (…) next to Download.
  2. Select Connect Device.
  3. Select Next.
  4. Select Pair.
  5. Click the micro:bit name in the list and select Connect.
  6. The file downloads onto the micro:bit. A light on the back of the micro:bit flashes while your code is downloading.
  7. The next time you click Download during this session, it remembers this connection.

As a file

  1. Select Download.
  2. Open the folders on your computer.
  3. Find the .HEX file in your Downloads folder.
  4. Drag the .HEX file to the MICROBIT drive. A light on the back of the micro:bit flashes while your code is downloading.

You can switch back to Standalone Mode from MakeCode Mode by downloading the Standalone Firmware onto the micro:bit. See the firmware directions.