Using BBC micro:bit with Scratch / S2Bot


Important: only v1.3 micro:bit devices will work with the hex file supplied within the app.

The new v1.5 board has had a design change and needs this new hex file instead (unzip before use).

The micro:bit version number is engraved on the back of the board (very small text in corner by the large connector '0' hole).

 

The S2Bot app allows you to use the BBC micro:bit as a bluetooth 'games controller' for your Scratch v2 offline (or Snap!) project.

Scratch with BBC micro:bit

Supported features include:

  • detect button presses
  • detect tilt (acceleration) and bearing
  • detect temperature changes
  • display text messages on the micro:bit
  • create sounds (additional piezo required between P0 and 0V)
  • detect analogue voltage changes on P1 and P2

What you will need:

  1. A BBC micro:bit
  2. Windows/Mac/Linux/Chromebook computer
  3. BLED112 bluetooth dongle (not required for Chromebooks)
  4. (Optional) Kitronik MI:power board (provides both battery and piezo sounder)

Initial Installation:

  1. Install the S2Bot App from here
  2. Insert the BLED112 bluetooth dongle and let the driver install (more details here)
  3. Start the S2Bot App.
  4. Select 'BBC micro:bit' from the drop down list of devices
  5. From the menu button (top right) select 'Program micro:bit'
  6. Save the 'microbit-s2bot.hex' firmware hex to your desktop
  7. Connect the micro:bit to the computer via the USB cable
  8. Drag the 'microbit-s2bot.hex' file from your desktop to the MICROBIT drive (to reprogram the micro:bit)
  9. Disconnect the micro:bit from the USB cable
  10. Connect a battery to the micro:bit (hold it flat, with LEDs facing up)
  11. Micro:bit will now ask you to 'DRAW A CIRCLE' (or 'FILL SCREEN')  to calibrate the sensors. Do this by tilting the micro:bit around until all the required LEDs are lit. You should then see a smiley face to show that calibration worked. If instead you see a triangle of 3 dots disconnect the battery and then try the calibration again.

Phew. Lucky we only needed to that lot once! Now we are ready to go.


Using S2Bot App:

  1. Select 'BBC micro:bit' from the drop down list of devices
  2. Click the 'Scan for devices' button.
  3. You should see your micro:bit appear in the list of bluetooth devices. If you do not see the microbit switch the micro:bit power off/on (and you can also try restarting the S2Bot app).
  4. Click on the device name to connect it (no pairing is required).
  5. When connected (takes 5 seconds or so) you will see tilt/temperature data etc on screen. 
  6. Click 'Close' to close the connection dialog.
  7. Click on the menu button and select 'New Scratch template'. Save the .sb2 template to your desktop.


Using Scratch:

  1. In Chrome browser go to https://scratch.mit.edu and click Create.
  2. From the File menu select 'Upload from your computer'
  3. Select the .sb2 template file you saved earlier.
  4. Scratch should now 'connect' to S2Bot and the new micro:bit blocks will be available in the 'More Blocks' section. You can tell if Scratch and S2Bot are connected via the green 'connected' LED in both applications.

Now it's up to you - be creative!


An example .sb2 file that shows all the micro:bit functions can be downloaded here (unzip before use).