Skip to content

Commit b2e1326

Browse files
committed
Add loop for network time to sync in setup()
1 parent 3ad8c0c commit b2e1326

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

examples/Tweeter/Tweeter.ino

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,14 @@ void setup() {
6666
Serial.println("You're connected to the network");
6767
Serial.println();
6868

69+
Serial.print("Waiting for the network time to sync ");
70+
while (getTime() == 0) {
71+
Serial.print(".");
72+
delay(1000);
73+
}
74+
Serial.println();
75+
Serial.println();
76+
6977
// assign the OAuth credentials
7078
oauthClient.setCredentials(consumerKey, consumerKeySecret, accessToken, accessTokenSecret);
7179

0 commit comments

Comments
 (0)