[AMENDED topic] Detecting an Emergency Stop on Arduino

Robin2:
Don't use code for a safety stop.

Just have a big red button that cuts off power to the dangerous part of the machine.

As an extra you could have code in the Arduino that detects when the big red button is triggered - but only AFTER the safety stop has happened.

...R

That's EXACTLY what I want - "Arduino that detects when the big red button is triggered - but only AFTER the safety stop has happened."

I what I am trying to achive to to stop the CODE safely to avoid it returning/reading undesired values the moment the e-stop is pressed.

As I already said is my previous post what I would like to do (if possible) is:

On intr,
set eStop = 1
safely stop code
Goto 0 (which the start of the loop)

Is that achievable?