// Relay Demonstration
//
// 17 May 2024, by Koepel, Public Domain.
// The pins for the relay modules.
const int relay1Pin = D2;
void setup()
{
// Set pins as output.
pinMode(relay1Pin, OUTPUT);
delay(1000);
}
void loop()
{
// Activate the relays one by one for one second.
// The relay module simulates a module that
// is activated with a high level at the "IN" pin.
digitalWrite(relay1Pin,HIGH); // Activate relay.
delay(1000);
digitalWrite(relay1Pin,LOW); // Release the relay.
delay(1000);
}