added elapsed timer and connected status printout

pico-mitt
alanbjohnston 3 years ago committed by GitHub
parent 7d60ce1cdf
commit f843ff4323
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -4556,14 +4556,18 @@ void prompt_for_input() {
Serial.println("Connecting to Wifi");
const char ssid2[] = "CubeSatSim";
const char pass2[] = "amsatao7";
unsigned int elapsed_timer = (unsigned int) millis();
WiFi.begin(ssid2, pass2);
// WiFi.begin(ssid, pass);
while (WiFi.status() != WL_CONNECTED) {
while ((WiFi.status() != WL_CONNECTED) || ((millis() - elapsed_timer) > 10000)) {
Serial.print(".");
delay(500);
}
if (((millis() - elapsed_timer) > 10000))
Serial.println("Failed to connect!");
else
Serial.println("Connected to WiFi!");
} else
Serial.println("No password entered.");
} else

Loading…
Cancel
Save

Powered by TurnKey Linux.