I know that using delay halts the code whilst the delay is in action. Does this pause the code for the entire programme or just the function within which it is placed?
Regards,
James
I know that using delay halts the code whilst the delay is in action. Does this pause the code for the entire programme or just the function within which it is placed?
Regards,
James
Does this pause the code for the entire programme
Yes
Actually a few things are still alive if you want to go in the details (Serial communication that appears at the RX pin is recorded, PWM (analogWrite) values and pin states are maintained, and interrupts will work as they should). But for the most part your program is on hold.
It's in the doc for the delay() function...
Thank you for the confirmation and reference.
James.
catceefer:
Does this pause the code for the entire programme or just the function within which it is placed?
What is the difference? When you call a function, that is what is being done just now. When you call a function the main code doesn't press on regardless. It waits until the function returns.
Good point.
James.