Go Down

Topic: Tutorial for keypad (Read 12291 times) previous topic - next topic


I have problem to get library and tutorial to connect my keypad, LCD Display(HD 44780) and arduino. Im using Arduino UNO but I do not know the type of the keypad. This the image of the keypad. Could anyone please tell me the type or code of the keypad or any tutorial and library that I can use to connect the three things (Arduino, keypad and LCD display).


Sorry for image does not appear. But, how actually to insert image from my computer in this forum?

Thanks for any information and help..

James C4S

Sorry for image does not appear. But, how actually to insert image from my computer in this forum?

Use a service like imgur.com to host the image.  Then you post a link with the "img" tags.
Capacitor Expert By Day, Enginerd by night.  ||  Personal Blog: www.baldengineer.com  || Electronics Tutorials for Beginners:  www.addohms.com


thanks. I will try to use it.


Here the link for the picture of the keypad and LCD screen.

Thanks a lot for any help.


Jan 24, 2011, 07:08 am Last Edit: Jan 24, 2011, 07:23 am by CrossRoads Reason: 1
When posting, press the 3rd button from the left in the top row
it will insert 'bracket img bracket' and 'bracket /img bracket' in the message.
Paste the link to your .jpg format picture in between.
Also, resize your images to be around 640 pixels wide <- -- ->.

It looks like your first image is a velleman keypad; here is some code I modified from the keypad tutorial to read it
// added Keypad example from playground
// modified to send character in a buffer to the receiver from 4x4 matrix

// Velleman 4 x 4 matrix keypad
// keypad 1 (Col1) to D10
// keypad 2 (Col2) to D9
// keypad 3 (Col3) to D8
// keypad 4 (Col4) to D7
// keypad 5 (Row1) to D6
// keypad 6 (Row2) to D5
// keypad 7 (Row3) to D4
// keypad 8 (Row4) to D3

// Rows have Internal Pullups

#include <Keypad.h>         // Matrix Keypad library
// set up the Keypad
const byte ROWS = 4; // Four rows
const byte COLS = 4; // Four columns

// Define the Keymap
char keys[ROWS][COLS] =
 {    '1','2','3','A'      }  ,  // row 1
 {    '4','5','6','B'      }  ,  // row 2
 {    '7','8','9','C'      }  ,  // row 3
 {    '*','0','#','D'      }  ,  // row 4

// Connect keypad ROW1, ROW2, ROW3 and ROW4 to these Arduino pins.
byte rowPins[ROWS] = { 6, 5, 4, 3  };  // Keypad uses internal pullups? No externals supplied

// Connect keypad COL1, COL2, COL3, COL4 to these Arduino pins.
byte colPins[COLS] = { 10, 9, 8, 7 };

// Create the Keypad
Keypad keypad = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS );

void setup ()
{ // other setup code}
void loop ()
   // go read the keypad
 char key = keypad.getKey();                 // reading the keypad
 if(key)                                     // same as if(key != NO_KEY)- did something change?
  // do something with the keypress, such as:
case '0':
// insert action to do on button 0 being pressed
case '1':
case '#'
case 'D':
} // end switch
} // end if key pressed

// other actions
} // end void loop
Can't help with the LCD, don't recognize it, haven't used one yet.

Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131