I am currently working on the project 3 phase fault detector using arduino uno. Here i have to control the relay with single button. i want to make the code like , if i press the button for short duration suppose 1 sec. the relay should cut off for 1 sec. and if i press the button for long duration say about 10 sec. relay must cut off permanently.can any one help me in my coding. i found it very difficult to control the relay with single button in two ways?
Try the debounce example
Play with the duration setting