hi can u help me.I faced a problem here....i make one project about sms walkie-talkie......i want make hardware using keypad, LCD and arduino nano for send message.......keypad can type message and send to LCD........can u help me design of LCD,KEYPAD and arduino nano v3.0 and coding......... my LCD doesn't display anything on screen and keypad (keypad 3x4 matrix 12-KEY Membrane Switch Keypad AVR 51)not function......I attached my coding, hope anyone can advice and help me.
#include <LiquidCrystal.h>
#include <Keypad.h>
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','*'}
};
// Define the Keymap//
byte rowPins[ROWS] = { 13, 10, 9, 8 };// Connect keypad ROW1, ROW2, ROW3 and ROW4 to these Arduino pins//
byte colPins[COLS] = { 7, 6, A5 }; // Connect keypad COL1, COL2 and COL3 to these Arduino pins//
Keypad keypad = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS );//end of creating the Keypad//
LiquidCrystal lcd(12, NULL, 11, 5, 4, 3, 2); //create the lcd variable
void setup() {
lcd.clear(); //clear the LCD during setup
lcd.begin(8,2); //define the columns (8) and rows (2)
}
void loop() {
char key = keypad.getKey();
lcd.clear();
delay(1000);
if (key != NO_KEY)
{
lcd.clear();
lcd.home();
lcd.print("A");
delay(1000);
}
lcd.clear();
lcd.home();
lcd.print("ABC");
delay(1000);
lcd.clear(); //clear LCD, since we are still on 2nd line...
lcd.home(); //set the cursor the top left
}