//Connect D1 to RELAY R1 or R2
#define RELAY_PIN 5 // ESP8266 pin GIOP5 connected to the IN pin of relay
  
// the code in setup function runs only one time when ESP8266 starts
void setup() {
  // initialize digital pin as an output.
  pinMode(RELAY_PIN, OUTPUT);
}

// the code in loop function is executed repeatedly infinitely
void loop() {
  digitalWrite(RELAY_PIN, HIGH);
  delay(1000);
  digitalWrite(RELAY_PIN, LOW);
  delay(100);
}
