Programming I/O

I am needing a Script to do the following:

  1. Accept an input from a simple Normally Open contact Closure (push button) to start sequence.
  2. When button is pressed: fire relay 1 for 30 seconds. After 30 seconds, release relay 1. Then need the script to fire relay 2 for 30 seconds and then Release relay 2. No loop is required.

It’s not complicated but Where is your attempt?

(There might need a loop if you want the system to be ready again after that cycle for the next button press and you need to decide if you want to trigger on press or release of the button for example)

If you want someone to write this for you, and are ready to pay, you should post in the Gigs and Collaboration sub-forum

Bigbry77:
. . .
2. No loop is required.
. . .

This rather remarkable requirement indicates that this is likely to be an academic exercise a.k.a. school work.
I guess the idea is to contrive constraints on a solution in such a way that the student is forced to learn about hardware timers and their associated interrupt service routines.

Except that as stated the solution could all be in setup(). One if statement,a few digitalWrite()s and a couple of delay()s will do it.

That's assuming that "No loop is required" just means it's a one-shot sequence that doesn't need to repeat.

Steve

Yes - all is possible. OP needs to just clarify and post his attempt :slight_smile: