I just purchased a genuine Arduino Micro board and I am trying to figure out what pins are have interrupts . I have found several diagrams that give me different answers. The attached diagram says the RX and TX are pins 20 & 21 and interrupts 2 & 3 but when I try and use this in my code the information I get is incorrect. I have found other diagrams that say Rx & TX are pins 1 & 0 .
I used pins 2 & 3 on an Arduino Mega and everything worked fine.
The Micro uses the same pinout as the Leonardo. If you look in pins_arduino.h for the Leonardo you will see the macro that maps pin number to interrupt number:
Pins 0, 1, 2, 3, and 7 have external interrupts 2, 3, 1, 0, and 4 respectively. Note that Pin 2 and Pin 3 have 0 and 1 on the UNO but 1 and 0 on the Leonardo/Micro. Best to use the macro.
johnwasser:
The Micro uses the same pinout as the Leonardo. If you look in pins_arduino.h for the Leonardo you will see the macro that maps pin number to interrupt number:
Pins 0, 1, 2, 3, and 7 have external interrupts 2, 3, 1, 0, and 4 respectively. Note that Pin 2 and Pin 3 have 0 and 1 on the UNO but 1 and 0 on the Leonardo/Micro. Best to use the macro.
Thank you. I switched to pins 0 & 1 and used inter 2 and now it works. My diagram had pin 7 as inter 6 and that still didn't work even when I switched it to inter 4.