Micro:bit and app inventor

Hi!

Has someone a working example code for micro:bit and app Invenotor? I have tried Ghica's example, App Inventor, Micro:bit and UART but it doesn't work.

Svein-Tore

Svein-Tore, it is not very helpful to say that it does not work.
Please tell me what you tried and what the sympoms are of "it is not working".
Maybe we can then find out what the problem is.
Alternatively, try the new tutorial: The Internet of Things: Data Acquisition and Analysis
That should work too. You may need to look for the latest BLE extension.

OK!
I have been working for a long time with an app, which I succeeded to get work in august. So, when I wanted to install it on a new phone now in september I got an 908 error. I guess this has something to do with nb194? So, to start all over again, I wanted to see what I could found out there of code for microbit and bluetooth. And I ended up with the tutorial that you have made. So over to what I have done:

  1. I downloaded BTstarter.aia, and installed the app on my andorid device.
  2. I downloaded microbit-UART-RW.hex, and flashed it to a microbit V2.
  3. I made the micro:bit in pairing mode and paried the phone and micro:bit successfully.
  4. I started the app.

I pressed scan, but the micor:bit will not appear on the list.

It is important to tell this is an hour ago, on a samsung S8.

So, when I come home, I decided to test it on a samsung A6.

  1. I downloaded BTstarter.aia, and installed the app on my andorid device.
  2. I downloaded microbit-UART-RW.hex, and flashed it to a microbit V2.
  3. I made the micro:bit in pairing mode and paried the phone and micro:bit successfully.
  4. I started the app.

I pressed scan, the micro:bit appeared on the list, I pressed connect, and it did!

Well, this must be a detailed explanation on what has happend? But why won't it work on a Samsung S8?

The app I have created also work on samsung A6. It gives an Error 908: The permission BLUETOOTH.CONNECT has been denied at start up, but i works. I get this error for BTstarter.aia also, but it work.

I will do some more testing on Samsung S8.

Ups, I forgot to say that for the BTstarter.aia I have added the following code:

I think thats what solved the problem​:+1::blush:

Probably it is a permission thing, which has to do with the Android version you are using.
If you go to the tutorial, you will see a beta extension, which you shuold use, or use the updated .aia, also to be found in the tutorial. There has been a lot of discussion about this, which you can search for.
I happen to have a Pixel7, which should have the latest Android version, and my app works fine on it.

Instead, you could use the updated BLE extension, which asks for the permission for you.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.