NFC Shield V2 with Arduino MEGA

Hi,



If you are trying to run this sketch on mega then you need to change the SPI pins of Mega that is different from the SPI pins of Uno. See the tutorial below for the SPI interface of mega.



<LINK_TEXT text="
Tutorial: Arduino and the SPI bus – tronixstuff.com … -spi-bus/
">
Tutorial: Arduino and the SPI bus – tronixstuff.com
</LINK_TEXT>



Also you need use the CS pin of mega in this line of code.

Instead of this:
</s><i> </i>PN532_SPI interface(SPI, 9); // create a SPI interface for the shield with the SPI CS terminal at digital pin 10 <e>

You need to use this:
</s><i> </i>PN532_SPI interface(SPI, 53); // create a SPI interface for the shield with the SPI CS terminal at digital pin 10 <e>

I hope it will help you.