I think the external interrupts on my maple aren't working and this is why:
1) I connected pin 2 and pin 9.
2) I wrote a program that installs an interrupts handler for pin 2 and generates a square wave using pin 9.
3) when the program runs, the interrupt handler never gets invoked. The same program works on my Arduino UNO. Here it is:
/*
* Interrupt test
*/
const int analogOutPin = 9; //Pin 9 and Pin 2 are wired together.
const int analogInPin = 2;
volatile int count = 0;
void setup()
{
pinMode (analogOutPin, OUTPUT);
pinMode (analogInPin, INPUT);
attachInterrupt (0, handler, RISING);
}
void handler ()
{
count++;
}
void loop() {
digitalWrite (analogOutPin, HIGH);
delay (50);
digitalWrite (analogOutPin, LOW);
delay (50);
SerialUSB.print (count);
SerialUSB.print ("\n");
}
What am I doing wrong?