const unsigned int switchPin = 5;  //GPIO5 >>> D3

void setup()
{
  Serial.begin(115200);
  pinMode(LED_BUILTIN,OUTPUT); 
  pinMode(switchPin,INPUT);
  digitalWrite(switchPin, LOW);
}

 void loop()
{
  bool digitalVal = digitalRead(switchPin);
  if(digitalVal == HIGH)
  {
    digitalWrite(LED_BUILTIN,LOW);  //turn the led on 
  }else
  {
    digitalWrite(LED_BUILTIN,HIGH);  //turn the led off
  }
}
