Connecting Your robot using Bluetooth low energy
<< Prev: Intro: Getting Started
The easiest way to connect your robot to Scratch is by using Bluetooth Low Energy or Bluetooth 4.0.
Note: Some computers do not have Bluetooth 4.0 capability. Visit this page to see if your computer does. If it states that Bluetooth is available' then these instructions should work on your computer. Otherwise, you will have to use Setup Option 2.
Resources
Scratch Website Link (https://mitmedialab.github.io/prg-extension-boilerplate/robotafe/)
Part 1: Installing a .hex file on your micro:bit
1. Plug your micro:bit into your computer.
Connect the small end of the USB cable to the micro USB port on your BBC micro:bit
Connect the other end of the USB cable to a USB port on your computer.
You should see the micro:bit appear on your computer.
2. Download the BLE_with_ultrasonic.hex file onto your micro:bit device.
The .hex file contains the code that allows your micro:bit to communicate with your computer.
If you happen to download the file somewhere else, then drag and drop it into your micro:bit device after.
While it's downloading, the yellow LED on the back of your micro:bit flashes (which should only take a few seconds).
Once transferred, the code will run automatically on your micro:bit.
4. Disconnect your micro:bit from your computer and plug it into your robot. See the picture on the left.
When you switch the robot on, the micro:bit will show an 'S' on its screen and the headlights will be red.
Now we can go to Scratch to connect the robot to the computer.
Part 2: Using Scratch to connect your robot to your computer
1. Click on the link below to open Scratch. The end of the URL should be robotafe.
Make sure you are using Google Chrome!
Note: If the Bluetooth Low Energy method works on your computer, bookmark the link so that you can find it easily next time.
2. Scroll down to the PRG Microbit Robot Blocks Category.
At first the status indicator will show an orange exclamation point ( ! ) which means the robot is not connected.
3. Click on the Connect Robot button.
Chrome will begin scanning for nearby Bluetooth devices. (Make sure your micro:bit robot is turned on!)
Select your micro:bit from the list of devices and click Pair.
4. After you click Pair, wait about a minute for the status indicator to change into a green checkmark.
The robot will show a 'D' and the headlights will be green.
Now your robot is ready to program!
From here on, you won't need to install another .hex file on your micro:bit. Whenever you are on the Scratch website you will be able to click the Connect Robot button and your computer should be able to find your robot.
To disconnect your robot, just turn it off or close the website on your computer.
Running into trouble?
If your robot suddenly becomes disconnected, it will flash a frowny face.
If this happens, turn the robot off, then on and reconnect it.
If the site can't find your device, make sure that Bluetooth is turned on for your computer:
Not all computers are BLE capable (this requires Bluetooth 4.0). If you get an error message about this then you can try using a Bluetooth chip or USB to connect your robot to your computer.
<< Prev: Intro: Getting Started