This is part of the sample code for Bluetooth inside loop()
// waiting for Spp Client to connect
bool connected = LBTServer.accept(20); <<<<<<<<<< block here for 20sec waiting for connection
This is not very useful as loop() is supposed to run often (very often) to do all the tasks the board have been programmed for controlling motor speed, position etc.
But the LBTServer.accept(20) stops the loop running for 20 seconds. This is unacceptable.
Can you change the library to match the Arduino ethernet library with
Server.available() returning an object when a bluetooth client connects.
i.e. make LBTServer.begin() start a back ground thread waiting for connections and then return the object when LBTServer.available() called.