Connecting BBC microbit V2 to Mit App Inventor

How can i connect BBC microbit V2 to Mit App Inventor?

Welcome Vera.

Read the entire discussion: App Inventor, Micro:bit and UART

Thank you very much.

Hello Vera, welcome to the App Inventor Community

You will need to use the MIT BLE Extension. Unfortunately, at the moment connecting to the micro:bit is not plain sailing. However, this Topic should help:

The very latest BLE Extension:

Hi Vera,
What do you want to do with the micro:bit while connected to a phone?
What is the version of Android that you have on your phone?

Hi Ghica.

I want the micro:bit to be sending and receiving information with the app I will create on MIT App Inventor.

Thank you very much

Here is a link to my tutorial, which includes a ready made .aia and a .hex file for communication between AppInventor and micro:bit.
I have updated the .aia to include the newest BLE extension.

2 Likes

Thank you very much @Ghica

We created an App but it keeps crashing when it is to connect to a microbit

I lost my crystal ball, so I have no clue what may be the problem. Please upload the .aia and the .hex file of your project.

1 Like



It worked well before then the app started crashing(closing) when it tries to connect.

Two remarks: from your blocks I cannot see which BLE extension you are using. You can find it here: Minor BLE Extension Documentation Mistake - #10 by Mr_Czechowski
or here: MIT App Inventor Extensions
The second remark: with the newest BLE extensions you do not need to ask for permissions anymore.
Try it.

It is not still working, do you have any tutorial you can point us to using the updated extension. The most painful thing is that it was working perfectly before it started crashing. Can you chat me up on Whatsapp Removed by mod

I do not do whatsapp.
What happened when your app started creashing? Any error messages?
You did not do what I asked: attach your .aia and your .hex and I promise I will take a look.

For downloading an .aia look here: Sharing and Remixing Apps
For downloading a .hex, if you have your project in microsoft makecode, look at the bottom of the page for download options.

IoT_STARTER2 (1).aia (488.2 KB)
microbit-Door-and-LightBLE-working.hex

Above are the files

Ok, so far I destroyed two microbits trying to load your .hex
I took a brand new one, and took out some stuff, because I cannot connect io pins. Here is my .hex:
microbit-DoorLight4.hex (1.3 MB)
This works. (I will be able to reset the other micro:bits I hope)
Your .aia works too, except that, once connected, you cannot disconnect because you set the visibility of the button arrangement to false.

Okay, thanks I will try it out and get back. The reason why there is no pin is because we are using microbit extension. And again why didn't the other two Microbit work. But did you connect several times. Because for us it worked before and then started crashing after connecting up to two or three times

You never told me what the symptoms of the crashing were, therefore I have no clue about the reason. Also, your .aia and your .hex were different from the screenshots of your blocks, so I have no clue what could have been wrong there.
The problem with micro:bits is that you must be very careful about memory usage and you never know when too much is too much.
Anyway, it could be a nice app when you get it to work!

Yes, so the last files I sent did work well, the microbit connected successfully up to 3 times and started crashing. The App closes when it is about to connect with the microbit. You will be able click on the microbit to connect. But when it is connecting the App closes.