Sorry for the delay.
I check the arduino method to send your bluetooth data and Yes it hangs when you send information every 10ms.
I modified your code for pico C-SDK and I was able to transfer data every 5ms. Maybe faster will work!
https://github.com/danjperron/PicowSendBT
You will need to install the pico c-sdk!
The code works but it is very coarse. I didn't have all information about your code so it is a simple conversion from Arduino to C-SDK.
I didn't take the time to clean it up. I just figure out how to create a separate project outside the example. Yeah the bluetooth example are quite embedded. This in my point of view! The example are really bad example for beginner since the srouce code is hidden in "lib" and you need to figure out which file hold the main().
I tried the code using my Pi5 and create an rfcomm device and I had no problem at all except that every time I need to remove the bluetooth device and re-install it.
So in conclusion the serialBT hangs because it doesn't check if it is able to send the data. The code I use will flag the data to be send and it will be send in the background.
Have fun to decipher What I did!
It was a learnig curve for me to figure out how pico bluetooth works. Before I was mostly using HC05/06 bluetooth.
regards,
Daniel
I check the arduino method to send your bluetooth data and Yes it hangs when you send information every 10ms.
I modified your code for pico C-SDK and I was able to transfer data every 5ms. Maybe faster will work!
https://github.com/danjperron/PicowSendBT
You will need to install the pico c-sdk!
The code works but it is very coarse. I didn't have all information about your code so it is a simple conversion from Arduino to C-SDK.
I didn't take the time to clean it up. I just figure out how to create a separate project outside the example. Yeah the bluetooth example are quite embedded. This in my point of view! The example are really bad example for beginner since the srouce code is hidden in "lib" and you need to figure out which file hold the main().
I tried the code using my Pi5 and create an rfcomm device and I had no problem at all except that every time I need to remove the bluetooth device and re-install it.
So in conclusion the serialBT hangs because it doesn't check if it is able to send the data. The code I use will flag the data to be send and it will be send in the background.
Have fun to decipher What I did!
It was a learnig curve for me to figure out how pico bluetooth works. Before I was mostly using HC05/06 bluetooth.
regards,
Daniel
Statistics: Posted by danjperron — Sat Apr 13, 2024 11:53 pm