Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Help me with keypad to mobile interface

Status
Not open for further replies.

osha

Member level 2
Joined
Nov 20, 2005
Messages
42
Helped
1
Reputation
2
Reaction score
0
Trophy points
1,286
Location
egypt
Activity points
1,623
keypad interface

hi all
please any one can help me in (making keypad to mobile please send his helping quicqly)
 

keypad interface

you have to be more specific
 

    osha

    Points: 2
    Helpful Answer Positive Rating
Re: keypad interface

with which microcontroller u r gonna interface the keypad?
 

Re: keypad interface

Code:
/*--------------------------------------------------------------------------
  Read Keys
  ------------------------------------------------------------------------*/
void read_switches(void) {
  static uchar kbuf[3];
  uchar code keycodeconv[22] = {   51, 52, 53,
                                  1 , 2 , 3 , 4 ,
                                  5 , 6 , 7 , 8 ,
                                  9 , 0 ,54 ,55 ,
                                     56 , 57    ,
                                  58,59,60,61,62
                               };
  find_key();
  kbuf[0] = kbuf[1];   kbuf[1] = kbuf[2];   kbuf[2] = kd;
  if (kbuf[0]==0xff && kbuf[1] != 0xff && kbuf[1]==kbuf[2]) {
    key_data = keycodeconv[kd];                  // valid key edge detected
  }
}

/*-------------------------------------------------------------------*/
void find_key(void) {

  kd = 0xff;

  R1 = 0; if (C1 == 0) kd = 0x00;
          if (C2 == 0) kd = 0x01;
          if (C3 == 0) kd = 0x02;
          if (C5 == 0) kd = 0x11; R1 = 1;

  R2 = 0; if (C1 == 0) kd = 0x03;
          if (C2 == 0) kd = 0x04;
          if (C3 == 0) kd = 0x05;
          if (C4 == 0) kd = 0x06;
          if (C5 == 0) kd = 0x12; R2 = 1;

  R3 = 0; if (C1 == 0) kd = 0x07;
          if (C2 == 0) kd = 0x08;
          if (C3 == 0) kd = 0x09;
          if (C4 == 0) kd = 0x0a;
          if (C5 == 0) kd = 0x13; R3 = 1;

  R4 = 0; if (C1 == 0) kd = 0x0b;
          if (C2 == 0) kd = 0x0c;
          if (C3 == 0) kd = 0x0d;
          if (C4 == 0) kd = 0x0e;
          if (C5 == 0) kd = 0x14; R4 = 1;

  R5 = 0; if (C2 == 0) kd = 0x0f;
          if (C3 == 0) kd = 0x10;
          if (C5 == 0) kd = 0x15; R5 = 1;
}
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top