Here is my app so far! Will post the MIT app file soon.
Really frustrated with this thing now!! So close yet so far away! Three major issues!
One the uart1 I’m using to communicate to the hc05 is not allowing me to have interrupt on rx receiving transmissions? If I jump a wire from rx to tx (loop back) the interrupt works fine, so it should be coded correctly.
Anyway then I have to use blocking functions in polling mode to read the data from the hc05 which doesn’t help with timing issues!!
And two I am transmitting tx data from the stm32 to the hc05 then to my app. Rpm, steps, delay, and motor running flag.
This takes a lot of processing attempting to send as a CSV string. And using sprintf causes a pretty decent lag.
And thirdly the problem with the app is that mit app inventor doesn’t have and function to have an interrupt when the tx data from the stm32 is available. So I am using a procedure called anytime a button is pressed then using a clock to set a delay then read the the incoming message, this never works even with delay as little as 100ms or as big as 9 seconds!
I also just tried to read the tx data in a clock function set at 300 ms intervals and it sorta worked but then the motor doesn’t stay running nor does the gif in the app stay running! In fact the gif has a major pause everytime the timer is up.
One solution could be to store steps, delay, rpm in the app, so the app is master Then only send the updated values to the hc05 and then the stm32, so just one way communication
I could also use dma for uart and my own sprintf to cut the time down