Skip to content

Commit 354f857

Browse files
Wait for connection in analogRead example
1 parent def2916 commit 354f857

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

examples/Example_AnalogRead/Example_AnalogRead.ino

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,21 @@ mapper_device dev = 0;
1111
mapper_signal output_signal = 0;
1212

1313
void setup() {
14+
Serial.begin(115200);
15+
1416
// Begin WiFi before creating mapper device
1517
WiFi.begin(ssid, password);
18+
19+
// Wait for connection
20+
while (WiFi.status() != WL_CONNECTED) {
21+
delay(500);
22+
Serial.print(".");
23+
}
24+
25+
Serial.println("");
26+
Serial.println("WiFi connected");
27+
Serial.println("IP address: ");
28+
Serial.println(WiFi.localIP());
1629

1730
// Initialize mapper device
1831
dev = mapper_device_new("ESP32", 0, 0);

0 commit comments

Comments
 (0)