Aurdino uno r3 to 5v relay

"Hi,
Would need help with a code for Arduino Uno. It will be placed on a machine, so it needs to be reliable (I just can't get it right. I think it's easy for someone who knows.

My Arduino should control 4 relays with buttons.
When I press button 1, the following should happen:
Relay 1 (close grip) for 1.5 seconds, then relay 2 (extend) for 3 seconds, then relay 3 (open grip) for 1 second, then relay 4 (retract) for 3 seconds, then start over again.
IMPORTANT: When I release the button, everything should pause immediately and continue there i stoped then i press it again.
When I press button 2, the following should happen:
Relay 3 (open grip) for 1 second, then relay 4 (retract) for 3 seconds."

It all begins with digitalRead, followed closely by digitalWrite.

@tinkercadtest
Please do not start a duplicate threads. it is a violation of the forum rules.

Moderators have been notified

I am sorry, not so god at this

What do you expect from the help? The software side? The hardware side? Both?

It may be... if you let us know what the actual problem is!

So two buttons only?

Does the button2 activity repeat or only go once each time?

Whilst paused, does the relay that was on stay on?

How fast is "immediate"? As fast as possible will be a matter milliseconds.

a7

I suppose you didn't take me seriously when I suggested in your previous thread that you review

To get paid help, or serious help, you're going to have to stop, organize your thoughts, and communicate. That forum guideline will aid you in doing so.
Ball's in your court, @tinkercadtest

Haha I vectored in from the other thread, which has a cleaned up description but leaves questions.

Never noticed it's now here in Jobs and Paid… where all questions answered will make any work easier, faster and cheaper.

a7

... and in the end the budget is 50 sneezes :rofl:

For those who are viewing this. This is just a simple correction to the parent post, It'll take the main post and rewrite it so others can understand...
(cause it still make no sense)


Hello,
I would like help coding my Arduino Uno. It will be used on a machine, so it needs to be reliable.

The Arduino should control 4 relays with buttons, when I press button 1:
relay 1 will be powered for 1.5 seconds,
relay 2 will be powered for 3 seconds,
relay 3 will be powered for 1 second,
relay 4 will be powered for 3 seconds,
then it'll start over again.

IMPORTANT: When I release the button, everything should stop immediately and if I press it again it'll start back up where I stopped it at.
When I press button 2:
relay 3 will be powered for 1 second, then
relay 4 will be powered for 3 seconds.


  • Spirit

So, you have two accounts? Or you're doing this for the OP without their participation? The information should come from the OP, not from what one of us imagines might be the intent. Unless you're a parent, why do this?

No, I'm not an alt or anything relating to this tinkercadtest person, Ill occasionally come across a post that generally makes no sense, and rewrite it so others can read it and help the author of the base post.

Its all just to make things easier for others.

1 Like

also feel free to @ me if there is a post you came across and ill rewrite it to my best ability, and if I have the time to.

Don't get me wrong, feel free to do it - but many of our new posters won't learn how to properly present a problem if someone does it for them. Meaning, they come back next week, with a different problem, and expect someone will just do what you're doing for them gratis again. If it were purely a language problem, there are tools for that, but usually it's a big symptom of confused thought, or lack of thought, which needs coaxing/correcting.
YMMV, carry on!

1 Like

How do you know that you're rewriting it to what they meant, and not what you think they meant?

I mean, it's nice of you and all, but there's a reason when I offer paid help that I start by rephrasing what they said back to them so we can be sure we're on the same page.

1 Like

Should all relays powered simultaneously when button 1 is pressed?

So you want this to function like a dead-man switch where everything stops when you release it, but with the added twist that when you press the switch again, it picks up from where it left off?

Interesting.

So how would you stop it in the middle of the sequence if needed? I mean stop completely, not pause.

Thats out of my knowledge, tinkercadtest did not state it, so I did not put it.

When Im rewriting a post, it means the same thing. For example, if you read the parent post, then read mine. The way you interpret it from the base is the same. Mines just easier to understand.