Keypad_I2C fails on Feather M0

Attempting to connect a 3x4 Matrix Keypad through an I2C pin extender (PCF8574) on Feather M0, a compiler error is thrown when trying to compile the example files which use the keypad_I2C library.

The source code is the example from the folder Keypad_I2C\examples\EventKeypad_I2C\EventKeypad_I2C.ino

The TwoWire constructor called from Keypad_I2C constructor seems to be looking for a SERCOM and the SDA and SCL pin numbers?

Any suggestions on how to get this working?

Thanks!


The Compiler error:

In file included from C:\Users\me\AppData\Local\Temp\arduino_keypads-master\Keypad_I2C\examples\EventKeypad_I2C\EventKeypad_I2C.ino:12:0:

C:\Users\me\Documents\Arduino\libraries\Keypad_I2C/Keypad_I2C.h: In constructor 'Keypad_I2C::Keypad_I2C(char*, byte*, byte*, byte, byte, byte, byte)':

C:\Users\me\Documents\Arduino\libraries\Keypad_I2C/Keypad_I2C.h:44:48: error: no matching function for call to 'TwoWire::TwoWire()'

Keypad(userKeymap, row, col, numRows, numCols) { i2caddr = address; i2cwidth = width;}

C:\Users\me\Documents\Arduino\libraries\Keypad_I2C/Keypad_I2C.h:44:48: note: candidates are:

In file included from C:\Users\me\Documents\Arduino\sketch_0913_kpdtest_pcf8574\sketch_0913_kpdtest_pcf8574.ino:6:0:

C:\Users\me\AppData\Local\Arduino15\packages\adafruit\hardware\samd\1.2.3\libraries\Wire/Wire.h:35:5: note: TwoWire::TwoWire(SERCOM*, uint8_t, uint8_t)

TwoWire(SERCOM *s, uint8_t pinSDA, uint8_t pinSCL);

^

C:\Users\me\AppData\Local\Arduino15\packages\adafruit\hardware\samd\1.2.3\libraries\Wire/Wire.h:35:5: note: candidate expects 3 arguments, 0 provided

C:\Users\me\AppData\Local\Arduino15\packages\adafruit\hardware\samd\1.2.3\libraries\Wire/Wire.h:32:7: note: constexpr TwoWire::TwoWire(const TwoWire&)

class TwoWire : public Stream

^

C:\Users\me\AppData\Local\Arduino15\packages\adafruit\hardware\samd\1.2.3\libraries\Wire/Wire.h:32:7: note: candidate expects 1 argument, 0 provided

C:\Users\me\AppData\Local\Arduino15\packages\adafruit\hardware\samd\1.2.3\libraries\Wire/Wire.h:32:7: note: constexpr TwoWire::TwoWire(TwoWire&&)

C:\Users\me\AppData\Local\Arduino15\packages\adafruit\hardware\samd\1.2.3\libraries\Wire/Wire.h:32:7: note: candidate expects 1 argument, 0 provided

exit status 1
Error compiling for board Adafruit Feather M0.

If you're using this library (you forgot the link to the used library!), you have to fix the library first before using it on a non-AVR Arduino. All calls to the I2C base library (Wire.h) are made using the TwoWire class calls instead of using the Wire object to call methods on it. This is wrong but works by chance on the AVR platform.