Quick Start of MicroBleMobile by MakeCode

A Unity 3D object ‘ tumbler’ in the Demo scene tilts based on acceleration data provided by the micro:bit. The micro:bit uses its built-in accelerometer to generate 3D Object acceleration ‘x, y, z’ data. The micro:bit sends the acceleration data from the micro:bit to Unity running on a Windows PC via the BLE (Bluetooth low energy) interface.

Additionally, when clicking a Unity 3D object ‘Button’ in the Demo scene, Unity sends the message obtained from a Unity 3D object ‘Inputfield’ to the micro:bit. Unity works on Windows PC and sends a message 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 this asset. 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 this asset 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’ > ‘Esp32BleAndroidInterface’ > ‘Scenes’ folder of the left side menu, double click on the Demo scene ‘Esp32BleAndroidSampleScene’ 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 this asset 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 Windows PC, then build a software development environment for this asset with the MakeCode according to ‘MakeCode for micro:bit.’
  2. [micro:bit Version2.x]

Step-3 Run Demo scene

  1. The installed this asset 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. Display the icon on LED screen after connecting to micro:bit.
  4. Set the message into Inputfield in the game screen, then click the Button ‘On’ to display the scrolled message in the LED screen of the micro:bit as follows.
  5. The Android Logcat displays the game status at clicking Button ‘On’ as follows.
  6. Display the icon on LED screen at clicking Button ‘On’ as follows..