MicroBleMobile Quick Start

A Unity 3D object ‘ tumbler’ in the Demo scene tilts using acceleration the generated data of the micro:bit. The micro:bit generates 3D Object position data ‘x, y, z’ using the SIN function. The micro:bit sends that data from the micro:bit to Unity through Android mobile phone using the BLE (Bluetooth low energy) interface.

When clicking a Unity 3D object ‘Button’ in the Demo scene, Unity sends the numerical data obtained from the Unity 3D object ‘Inputfield’ to the micro:bit. Unity works at Android mobile phone and sends the numerical data to the micro:bit using the BLE (Bluetooth low energy) interface.

The following shows the capture screen when the Demo scene runs.


This Quick Start explains how to display the Demo scene on Unity using MicroBleMobile. This Quick Start also includes some steps for downloading and setting up a package in Unity Project, and writing the micro:bit code.

Step-1 Download and set up a package in Unity Project
Step-2 Write micro:bit code using Arduino IDE
Step-3 Run Demo scene

Step-1 Download and set up a package in Unity Project

  1. Download MicroBleMobile from the Asset Store, and click on the Import button.
  2. The package is imported under the Assets folder in your Unity project.
  3. Click the Project tab, choose ‘Assets’ > ‘MicroBleMobileInterface’ > ‘Scenes’ folder of the left side menu, double click on the Demo scene ‘MicroBleMobileSampleScene’ in the Project window.
  4. Connect Android mobile phone by USB cable to Windows PC, build the purchased assets according to ‘Building games for Android’, and run it in Android mobile phone.
  5. Display MicroBleMobile from application information in Android mobile phone as follows. Change the Location permission to ON because of the need to enable Bluetooth Low Energy Scanning.

Step-2 Write micro:bit code using Arduino IDE

  1. Connect the micro:bit by Micro USB cable to Android mobile phone, then build a software development environment for MicroBle with the Arduino IDE according to ‘Arduino IDE for MicroBle’.
  2. Compile and write micro:bit code ‘microble-v2.1.ino’ of the folder ‘/Assets / MicroBleMobileInterface/ microble-v2.1’ into the micro:bit using the Arduino IDE.

Step-3 Run Demo scene

  1. The installed MicroBleMobile on Android mobile phone displays the game object as follows.
  2. The Android Logcat displays the game status as follows. The Android Logcat refer to ‘Install and Use Android Logcat’ for details.
  3. The ‘Serial Monitor’ of Arduino IDE displays the data “x, y, z” as follows.

  4. [ Not connect to Unity ]

    [ Connect to Unity and send acceleration data ]

  5. Set No0 / No1 into Inputfield ’No0’ / Inputfield ‘No1’ in the game screen, then click the Button ‘On’ to send to the micro:bit Show Inputfield ’No0’ / Inputfield ‘No1’ as follows.
  6. The Android Logcat displays the game status at clicking Button ‘On’ as follows.
  7. The ‘Serial Monitor’ in Arduino IDE displays the No0/No1 data as follows.