Would you consider using another programming language then MakeCode? I use MicroBlocks for all my microcontroller programming. Even the App Inventor team had a demonstration together with John Maloney, lead developer of MicroBlocks, during the latest AI summit.
To be clear, I am part of the MicroBlocks team so I am biased.
You could use MicroBlocks to program the micro:bit in this case. The micro:bit v2 gets a 3 letter code after you installed the microbit vm on it. In the sample aia I attached, you just have to enter the 3-letter code and you can connect to the micro:bit if it is programmed with microblocks. No need to search through a list.
As you can see in the aia, you can just send text commands over BLE. On the MicroBlocks side it would look like this when a command is received.
I guess it is a lot of info, but App Inventor <-> MicroBlocks is an ideal combination if you spend the time to get to know it.
We still are in need for an extension developer who is willing to make a special Open Source MicroBlocks BLE extension that can be used in App Inventor. It would be much easier to use, because a lot of things, that end users don't need to know are hidden, like all the UUID. The procedures would be blocks in the extension. For all the technical details, you would have to talk to John Maloney.
Okay, thanks for the support. I just downloaded the microblocks and I am in a way lost how do I add microbit. Do you have tutorial that can help. We can chat on whatsApp Removed by mod. Or arrange a call on Zoom or Meet. Thanks
I have been able to use the microblock and also looked at the aia file sent. But the whole thing looks a bit confusing. I think if we can see the microblock code for the aia code it will be easier for us to create what suit our project. Thanks.
There is no specific MicroBlocks code. The aia is a general use project. You type in the commands that you send to the micro:bit or you use the standard available ones.
So for instance you send stop to the micro:bit then you have to use the when received block to make the actions that has to happen.
That is why I gave you the small sample. Just use the aia, send stop and when stop received show the smiley face. Then you know it works.
You should not forget to put the vm on the micro:bit or did you do that already?
When you power up your micro:bit you see the 3 letter code on your led display of the microcontroller that has BLE. You can also see it when using the BLE id block. Every code is "unique".
Can't you connect using the normal way, displaying a list of BLE devices nearby and then choosing one?
It seems to connect now, I can press the send buttons, but how do I know what the micro:bit sees upon pressing one of these buttons?
And what about the i/o pins that must be adressed in the original question?