i want a code for inactivity shutdown
The relay should off if the pushbutton is not pressed within 1 minute. if i press the button at 59th second the relay should remain on for 1 minute.
(actually i need a code, just like screen saver of a PC) please help to do the code.im new to Arduino.
The idea here is that you try to produce your code, and we help you.
If you just want code pre-written, post in "gigs and collaborations", and be prepared to offer inducements.
you show us your homework
we help you help yourself
if you have put forth the effort to earn it
read https://forum.arduino.cc/index.php?topic=149014.0
and
On every pass through loop(), check to see if the switch is pressed. If it is, record when you discovered that, using millis.
On every pass through loop(), see how long is has been since the switch was pressed. If it has been too long, take whatever action is appropriate.
No rocket science involved, anywhere.
If you let go of the button, the rocket will turn into a cabbage..
lastchancename:
If you let go of the button, the rocket will turn into a cabbage..
Well, that's a good argument for using switches instead of buttons.