Connect to WiFi with Wemos Lolin D1 Mini Pro V2

Description: A green LED turns ON when a Wemos Lolin D1 Mini Pro connects to the internet via WiFi.

Connect to WiFi with Wemos Lolin D1 Mini Pro V2

Supplies:

1 –  Breadboard 400 Points
1 – Wemos Lolin D1 Mini Pro V2
1 – LED
1 – 220 Ohm Resistor

Arduino Code:

#include "ESP8266WiFi.h"

const char* ssid = "WiFi Network Name";    // Enter your WiFi SSID
const char* password = "password";  // Enter Password

#define led 4

void setup() {

  pinMode(led, OUTPUT);

  Serial.begin(9600);

  // Connect to WiFi
  WiFi.begin(ssid, password);
  Serial.println("");
  Serial.println("");
  
  while (WiFi.status() != WL_CONNECTED) {
  delay(500);
  Serial.print("*");

}

  Serial.println("");
  Serial.println("WiFi connection successful");
  Serial.print("IP Address: ");
  Serial.print(WiFi.localIP());

}

void loop() {

  if (WiFi.status() == WL_CONNECTED) {
  digitalWrite(led, HIGH);

}
}

Leave a Comment

+ 22 = 30