Interrupt code error: Message sending twice

@PAKring: the crucial observation to learn this stuff is that you do not need any Arduino specific expertise. What you want to learn is how the controller works. Almost everything you need to know is in the datasheets by Atmel. You want to read those. They are much more helpful then one might expect :wink:

Another thing is your explanation of the delay issue. The delay is NOT an interrupt. Hence there must be a different explanation.

My solution would have been to not block interrupts at all. There is an additional issue as well. Any fast bounce after you leave the loop might increment the counter to 2 before you enter it a second time. Thus you should better check for >1 instead of ==1.

And there is something lurking in the dark. The if condition is only atomic if int is a short int. If it is a 2 byte int it would still work but this is somewhat by chance. This is a time bomb waiting for an unsuitable moment to explode.
I would protect this part of the loop by blocking interrupts there. The rest is not really critical.

In addition I would not count inside the ISR calls but set the result to a fixed value. Reason: if for whatever strange reason the switch would bounce to produce a wrap around you would not enter the loop as well.

Udo