Hi! I am trying to blink an LED from MIT bluetooth app -> HC-06 connected to RaspberryPi Pico.
Here's the code from both the ends, the MIT app connects to the bluetooth HC-06 but no data is sent to Pico.
I tested the Pico HC-06 setup through another serial-bluetooth-app on android and that blinks the LED.
Can someone please help with what's going wrong here?
The snag is that via App Inventor Apps, Arduino is the most popular microcontroller family to work with, hence there is very little information about working with AI and Pi.
When an App Inventor App sends data via BT, how that data is collected and processed is entirely covered by the micro-controller's Script (known as a Sketch in the Arduino world).
If as you say, you have verified that a BT connection has been made, then the data ("C") should reach the Pi, but you have actually not got a connection.
There is a flaw in your App code where you have the [ListPicker Selection] being set by the [call BluetoothClient] function.
I attach a basic example Project that should prove if there is a connection and if so send text data ("Hello") on button click. I suggest you try this (change "Hello" to "C") and see if the Pi receives the data. If it does, you can modify the example as required or copy Blocks from it into your own Project (via the BackPack).
Thank you Chris! I tried the app you sent, it gives the same result - the connection is established but nothing happens on button click. There is no data sent to bluetooth (uart is empty).
While when I use another serial communication app with HC-06 on RaspberryPi Pico- communication is flawless, here's the display of data received from another serial communication app from my android - so I know the Pico microPython side works. I hv been trying to get MIT app to work for two weeks, have tried different baud rates, different UART channels.
Sample screenshot of RaspberryPi Pico- HC06 receiving data well from another android app: