i want serial print the digit i press in key pad 4*4 using i2c PCF8574 module
/* @file HelloKeypad.pde
Revised to use I2C i/o Feb 26/12 - G. D. Young
Re-check with Keypad 3.0, arduino 1.0.1 Jul 29/12
Add port-type parameter to constructor for Paul
Williamson's modification of the Keypad_I2C library Sept 2/13
|| @version 1.0
|| @author Alexander Brevig
|| @contact alexanderbrevig@gmail.com
||
|| @description
|| | Demonstrates the simplest use of the matrix Keypad library.
|| #
*/
#include <Keypad_I2C.h>
#include <Keypad.h>
#include <Wire.h>
#define I2CADDR 0x20
const byte ROWS = 4; //four rows
const byte COLS = 3; //three columns
char keys[ROWS][COLS] = {
{'1','2','3'},
{'4','5','6'},
{'7','8','9'},
{'*','0','#'}
};
// Digitran keypad, bit numbers of PCF8574 i/o port
byte rowPins[ROWS] = {0, 1, 2, 3}; //connect to the row pinouts of the keypad
byte colPins[COLS] = {4, 5, 6}; //connect to the column pinouts of the keypad
Keypad_I2C kpd( makeKeymap(keys), rowPins, colPins, ROWS, COLS, I2CADDR, PCF8574 );
void setup(){
Wire.begin( );
kpd.begin( makeKeymap(keys) );
Serial.begin(9600);
Serial.println( "start" );
}
void loop(){
char key = kpd.getKey();
if (key){
Serial.println(key);
}
}
C:\Users\pgnan\Downloads\A13_KeyPad\I2C_KeyPad\I2C_KeyPad.ino:33:74: error: 'PCF8574' was not declared in this scope
Keypad_I2C kpd( makeKeymap(keys), rowPins, colPins, ROWS, COLS, I2CADDR, PCF8574 );
^~~~~~~
C:\Users\pgnan\Downloads\A13_KeyPad\I2C_KeyPad\I2C_KeyPad.ino: In function 'void setup()':
C:\Users\pgnan\Downloads\A13_KeyPad\I2C_KeyPad\I2C_KeyPad.ino:37:31: error: no matching function for call to 'Keypad_I2C::begin(char*)'
kpd.begin( makeKeymap(keys) );
^
In file included from C:\Users\pgnan\Downloads\A13_KeyPad\I2C_KeyPad\I2C_KeyPad.ino:16:0:
c:\Users\pgnan\OneDrive\Documents\Arduino\libraries\libraries\Keypad_I2C-master/Keypad_I2C.h:30:14: note: candidate: void Keypad_I2C::begin()
void begin();
^~~~~
c:\Users\pgnan\OneDrive\Documents\Arduino\libraries\libraries\Keypad_I2C-master/Keypad_I2C.h:30:14: note: candidate expects 0 arguments, 1 provided
Multiple libraries were found for "Wire.h"
Used: C:\Users\pgnan\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\libraries\Wire
Not used: C:\Users\pgnan\OneDrive\Documents\Arduino\libraries\libraries\Wire
exit status 1
Compilation error: 'PCF8574' was not declared in this scope