Wait for Serial init in EI Examples setup functions

Since I have been looking through the EI Examples (for Arduino Nano BLE33 Sense) recently, please can I mention that not all the examples include the wait for serial init to complete. Overall these examples are great, and provide an excellent working reference and starting-point for further development. Thank you.

However the omission of the wait for completion of the serial initialisation means that some of the subsequent prints don’t come through (reliably). It is quite easy for the user to add this, but it would be nice if the examples already came with that.

e.g. to always pair these lines (with whatever baud rate is desired):

    Serial.begin(115200);
    while(!Serial);

I’ll illustrate this from a quick trawl of my current exported/imported example code from EI into Arduino editor to show which have the while(!Serial); and which don’t:

nano_ble33_sense_accelerometer: (no wait)

    // put your setup code here, to run once:
    Serial.begin(115200);
    Serial.println("Edge Impulse Inferencing Demo");

nano_ble33_sense_accelerometer_continuous: (no wait)

    // put your setup code here, to run once:
    Serial.begin(115200);
    Serial.println("Edge Impulse Inferencing Demo");

nano_ble33_sense_camera: (hoorah, a wait!)

    // put your setup code here, to run once:
    Serial.begin(115200);
    while(!Serial);
    Serial.println("Edge Impulse Inferencing Demo");

nano_ble33_sense_microphone: (no wait)

    // put your setup code here, to run once:
    Serial.begin(115200);

    Serial.println("Edge Impulse Inferencing Demo");

nano_ble33_sense_microphone_continuous: (no wait)

    // put your setup code here, to run once:
    Serial.begin(115200);

    Serial.println("Edge Impulse Inferencing Demo");

portenta_h7_camera: (no wait)

    // put your setup code here, to run once:
    Serial.begin(115200);
    Serial.println("Edge Impulse Inferencing Demo");

portenta_h7_microphone: (no wait)

    // put your setup code here, to run once:
    Serial.begin(115200);

    Serial.println("Edge Impulse Inferencing Demo");

portenta_h7_microphone_continuous: (no wait)

    // put your setup code here, to run once:
    Serial.begin(115200);

    Serial.println("Edge Impulse Inferencing Demo");

static_buffer: (no wait)

    // put your setup code here, to run once:
    Serial.begin(115200);

    Serial.println("Edge Impulse Inferencing Demo");

Hello @colosb,

I’ve created an internal feature request to add the while(!Serial); to all our examples.

Regards,

Louis