Hi! I have an ESP32 board, and I use Bluetooth to communicate with the Serial Bluetooth Terminal on my phone, in my code I need to print a message but using the SerialBT.print/SerialBT.println function doesn't print anything, the code is working and is doing what it should but it does not print any message...
Arduino framework relies on handling some background work like serial monitors and comminucations after each loop is done. Your program doesn't allow the loop to finish even once leading to the serial protocol not being handled properly.
use void loop as mentioned above or delete the while loop and continue with a non-blocking function. void loop() repeates infinitely no need for another while.
Serial I/O is handled entirely by interrupts. You can spend ALL your time in loop and Serial monitor I/O will still work just fine. BlueTooth may behave differently, depending on exactly which BT module and board is being used, and how they are connected.
Oh mb, I mixed it up with serialEventRun() for a moment... Sorry for the inconvenience.
yeah just use switch case.
Wait so you're able to see the values and not the start text? That could be caused due to your serial monitor not displaying first packet that arrives. (happened to me on rp2040 and vscode terminal) If so, you might wanna send a single garbage packet at setup like helloWorld and then you might be able to see the "1.Flight Time Programming"