Go Down

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

meowcat

Hello..
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).

meowcat

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

Quote
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

meowcat

thanks. I will try to use it.

meowcat

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





Thanks a lot for any help.

CrossRoads

#5
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
[code]
// 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:
switch(key){
case '0':
// insert action to do on button 0 being pressed
break;
case '1':
//
break;
:
:
case '#'
//
break;
:
:
case 'D':
//
break;
} // 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