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.

How to code from keypad to LCD screen

Status
Not open for further replies.

caramelz

Junior Member level 2
Joined
Jul 19, 2012
Messages
22
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,464
Using Pic18f4520, PORTA for the key encoder,

coded for keypad only. Guys please help


Code C - [expand]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#include <p18f4520.h>
#include <delays.h>
void main()
{
 int keyInputs;
 char keypress;
 ADCON1=0X0f;
 TRISA=0b11111111
 while(1)
{
 if(PORTAbits.RA4==1)
 {
  keyInputs = PORTA & 0x0f;
  switch(keyInputs)
 {
  case 0: keypress ='1'; break;
  case 1: keypress='2'; break;
  case 2: keypress='3'; break;
  case 3: keypress='F'; break;
  case 4: keypress='4'; break;
  case 5: keypress='5'; break; 
  case 6: keypress='6'; break;
  case 7: keypress='E'; break;
  case 8: keypress='7'; break;
  case 9: keypress='8'; break;
  case 10: keypress='9'; break;
  case 11: keypress='D'; break;
  case 12: keypress='A'; break;
  case 13: keypress='0'; break;
  case 14: keypress='B'; break;
  case 15: keypress='C'; break;
}
Delay10KTCYx(50);
}
}
}

 
Last edited by a moderator:

hi Shyam. My sch is asking us to do a security system. so I need a code to display the keypad numbers on the LCD screen. And to key in the password and led will light up.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top