Hello,
i am using PN532 RFID reader and I2C communication. On arduinos like Uno, ProMini, Mega it is working just fine, but on Nano Every there is some error during compilation in PN532_I2C.cpp. I tried MegaCoreX and also megaavr but with no luck.
C:\Users\JHRA\Documents\Arduino\libraries\NDEF\PN532_I2C.cpp: In member function 'int8_t PN532_I2C::readAckFrame()':
C:\Users\JHRA\Documents\Arduino\libraries\NDEF\PN532_I2C.cpp:196:73: error: call of overloaded 'requestFrom(int, unsigned int)' is ambiguous
if (_wire->requestFrom(PN532_I2C_ADDRESS, sizeof(PN532_ACK) + 1)) {
^
In file included from C:\Users\JHRA\Documents\Arduino\libraries\NDEF\PN532_I2C.h:8:0,
from C:\Users\JHRA\Documents\Arduino\libraries\NDEF\PN532_I2C.cpp:5:
C:\Users\JHRA\AppData\Local\Arduino15\packages\arduino\hardware\megaavr\1.8.7\libraries\Wire\src/Wire.h:61:12: note: candidate: virtual size_t TwoWire::requestFrom(uint8_t, size_t)
size_t requestFrom(uint8_t, size_t);
^~~~~~~~~~~
C:\Users\JHRA\AppData\Local\Arduino15\packages\arduino\hardware\megaavr\1.8.7\libraries\Wire\src/Wire.h:63:12: note: candidate: size_t TwoWire::requestFrom(int, int)
size_t requestFrom(int, int);
^~~~~~~~~~~
exit status 1
Meanwhile, you have to change the library and use normal integers for the parameters.
Do you use this library ? https://github.com/nurun/arduino_NFC
You could change the calls to Wire.requestFrom():
// Wire.requestFrom((uint8_t)PN532_I2C_ADDRESS, (uint8_t)(length+2)); // old
Wire.requestFrom((int)PN532_I2C_ADDRESS, (int)(length+2)); // new
A good standard starts with good agreements and good documentation of the standard. However, I get the feeling that the Arduino team does not know yet in which direction they want to go with the parameters.
Sorry, i exactly don't know what to change in this library of mine. I tried to change some things, but with no luck. It says that the problem is on row 196 in
if (_wire->requestFrom(PN532_I2C_ADDRESS, sizeof(PN532_ACK) + 1)) {