App Inventor, Micro:bit and UART
Somehow, communicating with a micro:bit via UART is more difficult than it should be. For now, using the extensions as indicated in this tutorial, will ensure that everything works.
This tutorial is intended to show how to use Bluetooth Low Energy (BLE) to send messages to a micro:bit. This can be used to control a toy robot car or any device that uses a micro:bit as its brain.
This first part will only cover the basic communication with a micro:bit via BLE. A follow up tutorial will cover controlling a robot car, for example the Ring:bit car v2 or the DFRobot Maqueen, both available for less than 30$, not including a micro:bit, which should cost less than 20$ for a v2 version.
The micro:bit is an electronics board, intended for schoolchildren, to learn programming and simple electronics. It is also nice to use as the heart of a little robot. To be able to control this robot via App Inventor we need UART communication, which is not so easy to do.
Here is a pdf with the text of the tutorial:
microbitUART.pdf (1.6 MB)
Here are the links you need:
com.bbc.microbit.profile.aix (100.7 KB)
BTstarter.aia (191.3 KB)
BTReadWrite.aia (291.2 KB)
microbit-UART_RW.hex (1.5 MB)
Due to changes in the permission systen for Android, there is an updated BLE extension, at this moment still in beta:
edu.mit.appinventor.ble-20230223-beta.aix (200.0 KB)
Here is the app, updated with the newer extension:
BTReadWrite_2.aia (295.4 KB)
You will need this version when your phone is running Android 12 and up. Be sure also to have Location set to on in the settings of your phone.