#include <WiFi.h>
const char* ssid = "Wokwi-GUEST";
const char* password = "";
void wifiConnect(){
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED){
delay(500);
Serial.print(".");
}
Serial.println("Connected");
}
void setup() {
// put your setup code here, to run once:
pinMode(2, OUTPUT);
Serial.begin(9600);
Serial.println("Connecting to Wifi...!");
wifiConnect();
Serial.println("IP address: ");
Serial.println(WiFi.localIP());
}
void loop() {
// put your main code here, to run repeatedly:
delay(1000); // this speeds up the simulation
digitalWrite(2, HIGH);
delay(1000);
digitalWrite(2, LOW);
}