Setting Up micro:bit with MakeCode
Microsoft MakeCode is a beginner-friendly editor for coders moving from block to text programming, in either Python or JavaScript. It runs directly on your web browser and makes programming your micro:bit and RVR+/RVR simple.
Open MakeCode and Add the RVR/RVR+ Extension
Get started by opening the MakeCode micro:bit editor and start a new project.
Give your project a name like RVR_microbit_first_program.
In order to be able to program RVR+/RVR, you’ll need to install the RVR+/RVR extension. Select the “extensions” option in the sidebar.
Type “RVR+” or “RVR” in the search bar, then select the “RVR SDK” tile.
You’ll now see all of the RVR+/RVR blocks in the sidebar and are ready to start programming!
Create a Simple Program
MakeCode has lots of tutorials and examples on how to use their editor to program a micro:bit on their landing page. We encourage you to check them out to learn about all of the capabilities of your micro:bit V1 or V2.
For the purpose of getting up and running as quickly as possible with RVR+/RVR, drag and drop blocks to recreate the program below in MakeCode. You can drag and drop blocks just like you would in a Sphero Edu block program.
The program will:
wake up RVR or RVR+
turn the robot’s LEDs to yellow
run through a loop four times to drive forwards and backwards for 2 seconds
Flash the Program to the micro:bit
Now that you’ve created the program in MakeCode, it’s time to transfer it to your micro:bit. This process of copying a program into your micro:bit’s memory is called flashing.
There are two ways to flash a program from MakeCode to your micro:bit.
Drag and drop - Select the “Download” button to download the .hex file to your device. Connect your micro:bit to your computer. Then find the file and drag and drop it onto the micro:bit.
Direct flashing - Connect your micro:bit to your computer. Then select the three dots next to the “Download” button. Follow the instructions to connect to your micro:bit using web USB. Direct flashing is only available in the recent Chrome and Edge browsers.
For more information on flashing programs to your micro:bit, refer to micro:bit’s support site.
Run the Program on RVR+/RVR
Now that your program is downloaded onto the micro:bit, it’s time to run it on your RVR+ or RVR.
Disconnect the micro:bit from your computer, then plug it into your RVR+/RVR. Your robot should be powered off.
Press the RVR+/RVR power button and watch the program run!
Remix the program by adding, removing, and manipulating blocks and see what you can create!
Go Further
Looking for things to try next with MakeCode, micro:bit, and RVR? Here are a few ideas:
The RVR+ & MakeCode: Movement, Light, and Sound Sphero Edu activity will give you more essentials.
The Remote Control sample will walk you through using a gamer:bit to control RVR+/RVR.
Add a littleBits RVR+ Topper Kit with a micro:bit adapter and program your RVR to autonomously navigate around obstacles.