Hi all,
I just finished preparing my circuit using two PCF8574 to manage a 16x2 LCD and a keypad 4x4 course in I2C … connecting to my Arduino 2009 ,plug Power 5v SDA and SCL to pin A4 and A5 but i can not read the display pressed keys on the keypad.
Without the Seeedstudio GSM Sim900 everything work, i have try to change every possible address about PCF8574 but nothing.
[code]#include <Wire.h>
#include <LiquidCrystal_I2C.h>
#include <Keypad_I2C.h>
#include <Keypad.h>
#include <Wire.h>
LiquidCrystal_I2C lcd(0x20,16,2); // set the LCD address to 0x20 for a 16 chars and 2 line display
#define I2CADDR 0x24
const byte ROWS = 4;
const byte COLS = 4;
char hexaKeys[ROWS][COLS] = {
{‘1’,‘2’,‘3’,‘A’},
{‘4’,‘5’,‘6’,‘B’},
{‘7’,‘8’,‘9’,‘C’},
{’*’,‘0’,’#’,‘D’}
};
byte rowPins[ROWS] = {7, 6, 5, 4};
byte colPins[COLS] = {3, 2, 1, 0};
Keypad_I2C customKeypad( makeKeymap(hexaKeys), rowPins, colPins, ROWS, COLS, I2CADDR);
void setup()
{
lcd.init(); // initialize the lcd
lcd.backlight();
customKeypad.begin( );
Serial.begin(9600);
}
void loop()
{
char customKey = customKeypad.getKey();
if (customKey != NO_KEY){
lcd.print(customKey);
}
}[/code]
Any ideas
Thanks!!!