// By Inaki Iturriaga 9/7/23 // Define the pin that controls the relay module int relayPin = 3; // Define the pin that the button is connected to int buttonPin = 1; void setup() { // Initialize the relay and button pins pinMode(relayPin, OUTPUT); pinMode(buttonPin, INPUT); } void loop() { // Read the state of the button int buttonState = digitalRead(buttonPin); // If the button is pressed, turn the relay on for 5 seconds if (buttonState == LOW) { digitalWrite(relayPin, HIGH); delay(3000); digitalWrite(relayPin, LOW); } // Wait for 100 milliseconds before checking the button agasin delay(100); }