Hi,
I'm trying to use external interrupts on the Arduino Due but can't seem to get it working. Here is my code:
void setup(){
Serial.begin(115200);
pinMode(2, INPUT);
attachInterrupt(2, state_change, CHANGE);
}
void loop(){
}
void state_change(){
Serial.println("woot");
}
This should attach an interrupt to pin number 2 (according to
http://www.arduino.cc/en/Reference/AttachInterrupt ). I have also tried using the old way of attaching to interrupt '0' to use pin 2 and I have also tried interrupt '4' to use pin 19 as well as tried attach interrupt '19' to use pin 19 but nothing is working. I realise it may be bad practice to put a serial command in an interrupt function but this is just to get the interrupt working.
Has anyone used external interrupts on the Due yet?
Thanks
Mark