attachInterrupt error

Its the first time I'm trying to set up using an interrupt. I set up the proper "attachInterrupt" command in setup() with all the correct parameters and when I try to compile it, I get an error reading that the ISR is not declared in the scope.

The ISR WAS declared, but is under the loop(). However, if I move the ISR above the call to "attachInterrupt", it does not result in an error message. Which makes some sense to the novice programmer that I am.

But the example shown in the Arduino Reference for attachInterrupt() shows the ISR is declared after the loop(). Whats more, if I copy and paste it into my IDE, it compiles fine.

My code is almost 1000 lines long, so I wont attach it here, but I've attached a screen shot of the relevant part.

(deleted)

(deleted)

Forgive me I mis-worded it. It is physically, on my screen, UNDER the loop(). Newb mistake, for which I beg for your forgiveness.

Actually, I realized, after reading Nick Gammons extensive notes on Interrupts, that my error was in naming the ISR "reset". After changing it to "resetIt" it compiles fine.

I imagine this has something to do with the boards reset function which is the first priority for interrupts.

void setup() {
  // put your setup code here, to run once:
  attachInterrupt( 1, reset, RISING );
}

void loop() {
  // put your main code here, to run repeatedly:

}

void reset()
{
  ;
}
Sketch uses 654 bytes (2%) of program storage space. Maximum is 32256 bytes.
Global variables use 13 bytes (0%) of dynamic memory, leaving 2035 bytes for local variables. Maximum is 2048 bytes.

No errors. Must be something else you changed that fixed it. This is why we ask for the full sketch, not snippets.

Jiggy-Ninja:

void setup() {

// put your setup code here, to run once:
  attachInterrupt( 1, reset, RISING );
}

void loop() {
  // put your main code here, to run repeatedly:

}

void reset()
{
  ;
}





Sketch uses 654 bytes (2%) of program storage space. Maximum is 32256 bytes.
Global variables use 13 bytes (0%) of dynamic memory, leaving 2035 bytes for local variables. Maximum is 2048 bytes.



No errors. Must be something else you changed that fixed it. This is why we ask for the full sketch, not snippets.

Yes, as mentioned above my error was in naming the ISR "reset". Changing the name immediately fixed it.

That's why I'm saying it has to be something else. I named my ISR "reset" too and there were no errors.