#include <WiFi.h>
char ssid[] = "Wokwi-GUEST";
char pass[] = "";
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
WiFi.mode(WIFI_STA);
}
void loop() {
if(WiFi.status() != WL_CONNECTED)
{
Serial.print("Attempting to connect");
while(WiFi.status() != WL_CONNECTED)
{
WiFi.begin(ssid, pass);
Serial.print(".");
delay(5000);
}
Serial.println("\nConnected.");
}
// put your main code here, to run repeatedly:
delay(10); // this speeds up the simulation
}