Skip to content

BBC micro:bit

BBC micro:bit Totem MiniTrooper remote control

Guide for Totem RoboBoard remote control using BBC micro:bit and MakeCode.

How it works?

  • micro:bit bluetooth uart service starts BLE server.
  • RoboBoard connects bluetooth uart service (advertised by micro:bit).
  • Block bluetooth uart write number is used to constantly send A and B button state.
  • RoboBoard intercepts pressed buttons in void microbitOnWrite(String data).
  • Function void microbitWriteString(String data) can be used to send data back to micro:bit (intercepted by bluetooth on data received block).

Setup micro:bit

Download provided MakeCode project to micro:bit.

Note: make sure "No Pairing Required" is selected inside Settings -> Project Settings.

MakeCode settings

Setup RoboBoard

Upload example code to RoboBoard: Microbit_Controller.ino
Note: Example is made for Totem MiniTrooper but can be adapted to other robots.

Functions
// Should be called inside setup()
// Establishes connection to micro:bit
void microbitBegin();

// Send number or string to micro:bit
// Will be received inside [bluetooh on data received] block
void microbitWriteString(String data);

// Receive data sent from micro:bit [bluetooth uart write] block
// [number] [string] [line] blocks are available, but they all send
// string (text) of certain length.
void microbitOnWrite(String data) {
  int length = data.length(); // Get number of characters transmitted
  int number = data.toInt();  // Convert received message to number
  Serial.println(string);     // Print received message to Serial Monitor
}

Check Arduino String reference for more functionality.

Connection

  1. Power on BBC micro:bit
  2. Power on RoboBoard (MiniTrooper)
  3. Press A + B buttons to control robot.
  4. Press RoboBoard X3 BOOT button to send it's state to micro:bit display.

Note: micro:bit tends to restart when plugged to PC. Power on MiniTrooper after micro:bit.