There is no USPS pickup on Monday Feb 15th, 2016 because of President's Day. USPS orders placed after 11am EST Fri February 12th will go out Tuesday February 16. UPS orders will ship as normal.

using interrupt pin 20 on Mega
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

using interrupt pin 20 on Mega

by sgtserg on Mon Mar 04, 2013 12:48 am

Hello,
I read that the arduino mega has four interrupt pins. I wanted to use pins 20-21, but these pins are also used for I2C. I tried writing a simple code to test the interrupt using these pins but no luck. When I used pin 19 it worked fine. I'm wondering if the reason that these pins are not working is because I need to declare these pins to be for interrupt. Thanks.

sgtserg
 
Posts: 24
Joined: Fri Oct 28, 2011 1:30 pm

Re: using interrupt pin 20 on Mega

by adafruit_support_bill on Mon Mar 04, 2013 8:16 am

You need to use the AttachInterrupt() function. Interrupt pins on the Mega are: 2, 3, 21, 20, 19, 18
http://arduino.cc/en/Reference/AttachInterrupt

You can also use pin-change interrupts on pins 10, 11, 12, 13, 50, 51, 52, 53, 62, 63, 64, 65, 66, 67, 68, 69
http://playground.arduino.cc/Main/PinChangeInt

adafruit_support_bill
 
Posts: 45791
Joined: Sat Feb 07, 2009 10:11 am

Please be positive and constructive with your questions and comments.