Pages: [1]   Go Down
Author Topic: Tutorial for keypad  (Read 8358 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 21
New
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

0
Offline Offline
Newbie
*
Karma: 0
Posts: 21
New
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Thanks for any information and help..
Logged

Austin, TX
Offline Offline
Faraday Member
**
Karma: 71
Posts: 6144
Baldengineer
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Capacitor Expert By Day, Enginerd by night.  ||  Personal Blog: www.baldengineer.com  || Electronics Tutorials for Beginners:  www.addohms.com

0
Offline Offline
Newbie
*
Karma: 0
Posts: 21
New
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

thanks. I will try to use it.
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 21
New
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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





Thanks a lot for any help.
Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 525
Posts: 26572
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.



« Last Edit: January 24, 2011, 01:23:57 am by CrossRoads » Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Pages: [1]   Go Up
Jump to: