Skip to main content

Microbit Guideline

The BBC micro:bit is a small, kid-friendly circuit board that makes learning to code fun and creative. It comes with cool features like a 5x5 LED display, two buttons, and a motion sensor. You can connect it to XRCC to build exciting projects that blend coding with the real world!

Getting Started

1. Install microbit HEX example file

  1. Connect a microbit to your computer with a USB cable.

  1. Download the microbit HEX example file [Click Here!]

  2. Drag and drop the HEX file onto your micro:bit.

2. Connect to Microbit in XRCC Edit Mode

  1. Power your micro:bit with USB or a battery pack.

  1. Open the bluetooth of your device.

  1. Open a XRCC project and go to behaviour Panel.

  1. Open the microbit panel.

  1. Scan the device.

  1. Connect the device.

  1. Connect successed! We can now test the microbit read and write interaction with Microbit Panel. In our example Hex file, the interaction will be:

    1. When Microbit Button A is pressed -> Receive “1” in XRCC

    1. When Microbit Button B is pressed -> Receive “2” in XRCC

    1. When we shake Microbit -> Receive “3” in XRCC

    2. When we send "." message to microbit, the microbit icon will change to heart.

3. Connect to Microbit in XRCC Play Mode

  1. Connect the Microbit successfully in microbit panel. XRCC will save the last connected device and connect it in Play Mode.

  1. Drag a "Connect Microbit" behaviour block.

  1. Create a string variable to store the received data from Microbit.

  1. Get Microbit data by using "On Received Data" behaviour block in play mode. The received data will stored into the "variable" variable.

  1. Use the received data to trigger actions in our XRCC Project.

Example of Interaction of Microbit Received Data

1. Check Received Data with Text Object

  1. Spawn a Text Object.

  1. Set its behaviour to the behaviour shown below:

  1. Now, when XRCC receives Microbit data, the text object's text will change.

2. Move the Cube with Received Data

  1. Ensure the "On Received Data" behaviour Block is called somewhere to store the microbit data to a variable. At this time, the block is called on the Text object if you have followed the above steps.

  2. Spawn a Cube Object.

  1. Follow the image below to set the behaviour:

When the microbit press button A, the cube will move upwards by 1.

  1. Here will be the result:

Advanced Usage:

Customize Microbit Code

  1. Go to Microsoft Makecode website and import our example HEX file.

  1. Edit the HEX file using Makecode. You can take reference from Microbit's official website and play with other sensors that can interact with Microbit!

  1. Export the code and burn it to your microbit.

  2. Connect the microbit to XRCC, you can start to create your content!