Perhaps I might receive better feedback here over the official support forums: I have made a little program to test the logic of the microcontroller of the device.
In many examples created by the manufacturer, to wait for a bluetooth connection in the setup() routine, the following code is used:
/* Wait for connection */
while (! ble.isConnected()) {
delay(500);
}
And it works correctly. However calling this from within the loop() method yields.... interesting results.
The logic of the Feather's microcontroller is tested in 4 ways:
If the bluetooth module is not connected, it should return false.
if (!ble.isConnected())
{
printBoth(F("True"));
}
else
{
printBoth(F("False"));
}
If the bluetooth module's connected status is false, it should return false.
if (ble.isConnected() == false)
{
printBoth(F("True"));
}
else
{
printBoth(F("False"));
}
If the bluetooth module is not connected or if the bluetooth module is not connected, it should return false.
if (!ble.isConnected() || !ble.isConnected())
{
printBoth(F("True"));
}
else
{
printBoth(F("False"));
}
If the bluetooth module is connected, it should return 1.
printBoth(String(ble.isConnected()));
Where "printBoth" is simply a function which outputs the string to both the Serial and bluetooth for display. If I run the program with an incremental timer, here are the results:
Test#, Delay in Seconds, Test 1 results, Test 2 results, Test 3 results, Test 4 results
- 0, True, True, True, 0
- 1, False, True, True, 0
- 2, False, True, True, 0
- 3, False, True, True, 0
- 4, False, True, True, 0
- 4, False, True, False, 0
So, I thought that was strange, but check this out....
- 4, False, True, False, 0
- 4, False, True, False, 0
- 4, False, True, False, 0
- 4, False, True, True, 0
- 4, False, True, False, 0
- 4, False, True, False, 0
So yeah, I don't know what's going on, but I don't know what to believe anymore...