Hi Dave,
Yes the switch probably bounced so it did toggle on then off again before you could see it. Or, you happend to press (and release) the button during the 25ms pause which in case means the program misses the button-press.... Or you pressed it and held it longer than 25ms (quite likely) so that when the program "came around" the button was still pressed so it toggled the LED again....

I'd try lowering that first pause a bit or remove it completely and instead add a pause after the TOGGLE GPIO.0 statement to remove any debounce. Then I'd make the program check that the button was released again before jumping back to Not_Pressed But remeber what happens with the interrupt latency when you're using things like Pause etc.

The BUTTON command is another posibillity but to be honest I don't know exactly how it works internally so I can't say what impact it will have on your interrupt latency.

Side note: You can assign aliases to the port pins (or any variable, register, bit etc). So you can do something like:
Code:
myButton VAR GPIO.5
LED_1 VAR GPIO.0
LED_2 VAR GPIO.2

If myButton = 0 then....
....
....
/Henrik.