From the learning page: https://learn.adafruit.com/adafruit-pn5 ... eld-wiring
I2C only uses two pins (Analog 4 and 5 which are fixed in hardware and cannot be changed) to communicate and one pin as an 'interrupt' pin (Digital 2 - can be changed however). […] The Interrupt pin is handy because instead of constantly asking the NFC shield "is there a card in view yet? what about now?" constantly, the chip will alert us when a NFC target comes into the antenna range.
Please give me an example on how to use the interrupt, if it is really possible.
NFC Shield with Interrupt
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- Franklin97355
- Posts: 23911
- Joined: Mon Apr 21, 2008 2:33 pm
Re: NFC Shield with Interrupt
The readMifare.pde file in the examples uses it.
- kariy
- Posts: 3
- Joined: Sun Nov 16, 2014 7:31 pm
Re: NFC Shield with Interrupt
I came to these forums looking for examples on how to use the interrupt on your NFC shield and found this thread...
Thank you!
I looked at that file, I don't see any use of interrupts. Can you point me to a specific line in the example you mentioned?The readMifare.pde file in the examples uses it.
Thank you!
- adafruit_support_rick
- Posts: 35092
- Joined: Tue Mar 15, 2011 11:42 am
Re: NFC Shield with Interrupt
The library polls the IRQ line. It does not actually use interrupts.
- kariy
- Posts: 3
- Joined: Sun Nov 16, 2014 7:31 pm
Re: NFC Shield with Interrupt
Right, thank you. Can you give me an example of how to use an interrupt with the shield?
- adafruit_support_rick
- Posts: 35092
- Joined: Tue Mar 15, 2011 11:42 am
Re: NFC Shield with Interrupt
Why do you want an interrupt? What are you going to do with it?
- kariy
- Posts: 3
- Joined: Sun Nov 16, 2014 7:31 pm
Re: NFC Shield with Interrupt
Well I want to be able to handle button presses, so what I wanted to do was each time a button is pressed I could somehow interrupt the busy waiting of the passiveRead method.
- adafruit_support_rick
- Posts: 35092
- Joined: Tue Mar 15, 2011 11:42 am
Re: NFC Shield with Interrupt
It's easier to just eliminate the timeout on readPassiveTargetID. See this thread:
viewtopic.php?f=31&t=59393&p=300270&hil ... ID#p300270
viewtopic.php?f=31&t=59393&p=300270&hil ... ID#p300270
Please be positive and constructive with your questions and comments.