Hi, I have tried to develop an app to receive the UART valule feedback by a micro:bit. The app is working fine however the bluetooth disconnection isn't working when I press the disconnect button.
I started by trying to the project file shared by @Ghica under the topic of App Inventor, Micro:bit and UART and it works fine. However, when i switched from Uart.write string to Uart.write number, the problem appears. I have to manually press the microbit reset button to disconnect the bluetooth connection everytime.
I have tried to insert the command of "call Microbit.uart1- requestTXCharacteristic" when bluetooth connected and "call Microbit.uart1-StopTXCharacteristicUpdates" when bluetooth disconnected yet the result is still the same. May someone enlighten me on this problem?
Post your blocks and/or .aia and the .hex from you micro:bit, so that I or someone else, can take a look.
If everything works fine with sending strings, why not just send strings then? On the micro:bit you can use "convert (num) to text" and "parse to number (text)", both from the Text blocks. On the AppInventor side you can just use text as numbers, no conversion needed.
There isn't actually a formal disconnect function for Bluetooth, so the App Inventor Bluetooth disconnect function may not work with every device. Usually however, we find something in the User's code that inadvertently keeps the connection going.