//Created by Barbu Vulc!
//Include the WiFi Library:
#include <WiFi.h>
//Replace with your network credentials & initialize the LED!
const char* ssid = "Wokwi-GUEST";
const char* password = "";
const int LED = 14;

void setup() {
  //Start the Serial Monitor
  Serial.begin(115200);
  //Operate in WiFi Station mode
  // WiFi.mode(WIFI_STA);
  //Start WiFi with supplied parameters
  WiFi.begin(ssid, password);
  Serial.print("Connecting to WiFi");
  while (WiFi.status() != WL_CONNECTED) {
    delay(100);
    Serial.print(".");
  }
  //Connection established!
  Serial.print("Franzininho WiFi is connected to Internet! \n");

  //Print SSID & IP adress...
  Serial.print("Assigned IP Address: ");
  Serial.print(WiFi.localIP());

  pinMode(LED, OUTPUT);
}

void loop() {
  delay(1000);
  if(WiFi.status() != WL_CONNECTED){
    //In case of Internet connection loss...
    digitalWrite(LED, LOW);
  } else {
    digitalWrite(LED, HIGH);
  }
}
Loading
franzininho-wifi