I am trying to keep the program within a loop until the user inputs "ok" on the Bluefruit Connect App. I use the readString() function on the bluetooth object (ble) to read from it. Before this loop, my String command variable is initialized to be empty. Here is my code:
while(!command.equalsIgnoreCase("ok"))
{
while(ble.available())
command = ble.readString()
}
I have confirmed that I can receive data as I can output the command variable to the Serial monitor. Why does the condition for this loop always return true (i.e. why is the String command variable never equal to the string literal "ok", while ignoring case)?