1 touch, 2 ssr. control one ac motor reverse and forward with one rgb led delay

Hi I quit

now i successfully made a sketch which can make this machine reverse and forward when i touch the sensore
with delay function.

Can you explain how the delay function can touch the sensor?

i want to put in this mills or interrupt kind of function so i van change the direction of motor any time but till now no success

Use millis() as explained in the blink without delay example. Do NOT even consider using interrupts. While an interrupt WILL interrupt the delay() function, control will return to the delay() function as soon as the interrupt handler ends. So, you will have accomplished nothing.

pasting the code with this.

The code goes BETWEEN the code tags, not after them. We don't need to see the code that uses delay(). We need to see your attempt to NOT use delay().

please help me its urgent

Not to us. You should have started sooner if you have a deadline.

whats the weak points in this . i want that when ever i touch button during running loop. the first relay time canceled and second relay time starts without any waiting for touch the button.

touch sensor attaches to pin d3 and gnd and 3.3 volts.

i tried to understand blink function and spent a lot of time on this also study interrupts but. because of new in arduino community. i fails insert these function in sketch. so please give me some guidance or solution as deadline is coming near.

how to insert millis in this code insted of delay 2500

how to insert millis in this code insted of delay 2500

Delete the sketch and start over. You can NOT just replace delay() with millis(). You must re-write the entire sketch.

On every pass through loop(), it is, or is not, time to do something. Perhaps there will even be several last times and several somethings that need doing.

If it is time to do something, do it, and record when you last did it.

You need to separate the logic of reading the switches, and debouncing them, and detecting state changes from doing something about the current state of the switch.

thanks PaulS can you gave me some example related to this like one in put and two out put with millis() function so on that base i can try to recreate this entire.

Try here

hi awol its same my post i am shifting it from project to programming fourm. because i face problem only in programming

thanks for reply

is ther any similar example

is ther any similar example

How about YOU CLEARLY stating your requirements?

How about YOU determine how YOU would turn the oven on, and then turn it off later (like 2.5 hours later) without standing in front of it like an idiot for 2 hours and 30 minutes, missing the big game?

If you put as much effort into thinking as you do in posting, you just might make progress. Or not, considering the quality of your posts...