problem with interrupts firing at the wrong time

I have a problem that I cant quite figure out whats causing it.

I’m using an Arduino Mega

I need to detect 3 momentary push buttons

im my code I called them

GoButton (pin 21)
travelLimit (pin 19)
Rest (pin 20)

Ive set up an interrupt for each button


And Im using the internal pull up resistors


For some reason, occasionally when I press the GoButton, the Reset gets triggered instead.

I’ve attached the entire Sketch too.

any help , ideas etc … is appreciated

keypad2.ino (10.6 KB)

What kind of wiring (e.g. network cable, ...)? What is the distance between Arduino and switches?

the distance is about 100 mm / 4 inches , why?

sammypati: the distance is about 100 mm / 4 inches , why?

Because you could be suffering cross-talk.

Why do you need interrupts to detect push button activation? Non-blocking polling from loop() would probably work fine.

Your right , interrupts may not needed in its current state, but the sketch isn’t finished yet.
Once I add the other features I need, I think I will need interrupts, but Ill know better once its all done.
If I need to I can easily remove them and place the checks inline in the Loop section.

Either way I cant see that making a difference to the issue I’m having. (unless I’m missing something?)

The problem could be cross talk, but I’m not sure how to get around that.

Any Ideas ?