Issue using two attachInterrupt

I just take a wire from the 5V of the arduino and link it to the pins 2 or 3 to generate the pin's value change like if it came from an external sensor

PaulS:

volatile int state = LOW;     // state of the LED1

volatile int state2 = LOW;    // state of the LED2
volatile int n = 1;
volatile int n2 = 1;



This just bugs me. Why would you number one variable and not the other?

You mean why I didn't define my variables as state1 and state2 instead of state and state2 ?!
I thought the example was easy enough not to make this effort, but I should have, I admit