if not connect, then led is off
but this below code not work, and ssid cannot scaned.
iam use NodeMcu V3.
#include <ESP8266WiFiMulti.h>
ESP8266WiFiMulti WiFiMulti;
const int led = 7; //pin on GPIO13 connected to LED
void setup(){
pinMode(led, OUTPUT);
digitalWrite(led, LOW); //turn off led
// set Wifi SSID and password
WiFiMulti.addAP("mywifi", "12345678");
}
void loop(){
// scanning wifi with SSID and password above
if ((WiFiMulti.run() == WL_CONNECTED))
{ digitalWrite(ledA, HIGH); //turn on led }
else
{digitalWrite(ledA, LOW); //turn off led }}