stop long fonction with delay without interuption when one In HIgh ? possible ?

Hello, i need to stop different fonctions declared in void() when on arduino input gone high...

Is it possible to do this without use of intreption ?

All my fonction ( open , close, and stop) are to switch on and off relay and all use delay().

Thanks for your help !

Is it possible to do this without use of intreption ?

Yes. Write the code so it isn't blocking.

All my fonction ( open , close, and stop) are to switch on and off relay and all use delay().

Not when you get done re-writing it.

Look at the blink without delay example showing how to make two things happen a fixed interval apart without using delay().

thaks for you reply !

I have take a look at millis() but i'm so newbee i'm not understanding >:(

I have make my fonction and my need under ardublock first and after with blockly@rduino...
in my my is so simple ! in blockly too... but impossible to translate in fonctionnal code :confused:

the use of milis() is like a loop is that ? so arduino make the test if elappsed x mils but make also other test ?
Is a sort of multitrading ?

So the awnser to my question is no ?
Is totally impossible to stop a fonction with different actions and delay() inside when one pin goes high without use of interruption ?

Thanks

Did you look at the blink without delay example? Your question was answered with, "yes" in reply #1.

Is totally impossible to stop a fonction with different actions and delay() inside when one pin goes high without use of interruption ?

During delay(), the switch is not being read, so it might as well not exist.

If you don't re-write the code to eliminate the blocking, then it is impossible to change actions with, or without, interrupts.

Imagine I called you, and said "meet me at our favorite watering hole, in 30 minutes, and I'll buy you a beer". Now, you live 5 minutes away. What you could do is run down to the bar, and then just sit there and wait for me, or, you could periodically check to see if it is time to leave. Meanwhile, you could be doing other things, like laundry, eating dinner, mowing the grass, etc.

You have to decide whether leaving code in it's current state, with blocking code, or totally rewriting it to not be blocking, is preferred.

ok thanks a lot i have to lear how to millis work drink a bear and rewrite my actions code.

THanks a lot !