How to implement arduino emergency button

Hello, I need to make sure that when the emergency button was pressed, attachInterrupt worked, set some pins to low and threw the void loop to the beginning (to check if the emergency button was pressed). How can I implement this

If it's an emergency, you shouldn't be worrying about software.

The main thing about emergency buttons is to shut off main-power directly through extra wiring that bypasses the main-control-unit.

This is done through a contact that is closed if the emergency-button is not pressed. A relay that switches on/off the main-power is only activated if the emergency-control-circuit is closed = relay-coil is powered

This ensures that any broken wire will shot-off power immediately too.
Bypassing the control-unit ensures that shutting off does NOT depend on a working main-control.
All this is done to maximise security.

If your demand for some actions inside the code is just an additional feature to the things described above it can be done.

I have no idea what this means

make sure that when the emergency button was pressed, attachInterrupt worked,

Without any details about

  • what IO-pins to switch
  • what IO-pin is connected to an extra-contact of the emergency-button
  • the control should be shutted off in case of an emergency or not

no further sugestions can be made.

But I have a question:
Is this some kind of assigment you have to do?

best regards Stefan

The loop function should be returning to the beginning thousands of times per second, if it's not then your code needs rewriting so it does. As you have not posted any code or given any other hints about your requirements I have no other advice.

To get a better answer start here:

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.