Skip to content

Commit 3de7530

Browse files
committed
add while(!Serial) to all examples
1 parent 83c5de0 commit 3de7530

File tree

6 files changed

+6
-0
lines changed

6 files changed

+6
-0
lines changed

libraries/Bluefruit52Lib/examples/Hardware/SerialEcho/SerialEcho.ino

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ const int baudrate = 115200;
2424
void setup()
2525
{
2626
Serial.begin (baudrate);
27+
while ( !Serial ) delay(10); // for nrf52840 with native usb
2728

2829
Serial.println("Serial Echo demo");
2930
Serial.print("Badurate : ");

libraries/Bluefruit52Lib/examples/Hardware/digital_interrupt_deferred/digital_interrupt_deferred.ino

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ int interruptPin = A0;
2323
void setup()
2424
{
2525
Serial.begin(115200);
26+
while ( !Serial ) delay(10); // for nrf52840 with native usb
2627

2728
pinMode(interruptPin, INPUT_PULLUP);
2829

libraries/SPI/examples/BarometricPressureSensor/BarometricPressureSensor.ino

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ const int chipSelectPin = 7;
3939

4040
void setup() {
4141
Serial.begin(9600);
42+
while ( !Serial ) delay(10); // for nrf52840 with native usb
4243

4344
// start the SPI library:
4445
SPI.begin();

libraries/Wire/examples/SFRRanger_reader/SFRRanger_reader.ino

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ void setup()
1616
{
1717
Wire.begin(); // join i2c bus (address optional for master)
1818
Serial.begin(9600); // start serial communication at 9600bps
19+
while ( !Serial ) delay(10); // for nrf52840 with native usb
1920
}
2021

2122
int reading = 0;

libraries/Wire/examples/master_reader/master_reader.ino

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ void setup()
1616
{
1717
Wire.begin(); // join i2c bus (address optional for master)
1818
Serial.begin(9600); // start serial for output
19+
while ( !Serial ) delay(10); // for nrf52840 with native usb
1920
}
2021

2122
void loop()

libraries/Wire/examples/slave_receiver/slave_receiver.ino

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ void setup()
1717
Wire.begin(4); // join i2c bus with address #4
1818
Wire.onReceive(receiveEvent); // register event
1919
Serial.begin(9600); // start serial for output
20+
while ( !Serial ) delay(10); // for nrf52840 with native usb
2021
}
2122

2223
void loop()

0 commit comments

Comments
 (0)