keypad,LCD and arduino nano

Talk about Arduino board, sheilds. Sharing Arduino projects, program, problems, solutions, suggestions..... many more, all are welcome.

keypad,LCD and arduino nano

Postby hariana » Wed May 23, 2012 1:13 am

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
}
hariana
Greenhorn
 
Posts: 2
Joined: Wed May 23, 2012 12:55 am

Re: keypad,LCD and arduino nano

Postby yonghui » Wed May 23, 2012 10:10 am

hmm..

better u debug one by one.
may start with connnection lcd and display someting successfuly 1st.

the lcd is 4bit mode or 8bit mode connected?


regards,
yh
thanks&regards,
yh
yonghui
Moderator
 
Posts: 732
Joined: Mon Sep 28, 2009 3:27 pm

Re: keypad,LCD and arduino nano

Postby shahrul » Wed May 23, 2012 12:16 pm

Try coding for LCD only before add another coding. Maybe hardware wrong.
User avatar
shahrul
Professional
 
Posts: 812
Joined: Sat May 16, 2009 9:54 pm
Location: Selangor

Re: keypad,LCD and arduino nano

Postby hariana » Thu May 24, 2012 12:01 am

LCD can display when i use coding 'hello word" but after i use keypeypad not function.........this my circuit ......can u help me
Attachments
230520122090.jpg
circuit LCD,keypad and arduino nano
hariana
Greenhorn
 
Posts: 2
Joined: Wed May 23, 2012 12:55 am


Return to Arduino Based

Who is online

Users browsing this forum: No registered users and 5 guests

cron