Skip to content

Commit 7985421

Browse files
committed
Correcting location of while(!Serial);
-We must first call Serial.begin() before waiting for it to become alive. -This also allows it to work with other micros that don't have native USB (like the ESP32 Thing Plus).
1 parent d62224f commit 7985421

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

examples/Example_01_RotationVector/Example_01_RotationVector.ino

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,9 @@ BNO08x myIMU;
5151
//#define BNO08X_ADDR 0x4A // Alternate address if ADR jumper is closed
5252

5353
void setup() {
54-
while(!Serial); // Wait for Serial to become available.
55-
// Necessary for boards with native USB (like the SAMD51 Thing+).
5654
Serial.begin(115200);
55+
while(!Serial) delay(10); // Wait for Serial to become available.
56+
// Necessary for boards with native USB (like the SAMD51 Thing+).
5757
Serial.println();
5858
Serial.println("BNO08x Read Example");
5959

0 commit comments

Comments
 (0)