CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

display keypad value to a lcd

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
lgeorge123



Joined: 05 Dec 2004
Posts: 31

View user's profile Send private message

display keypad value to a lcd
PostPosted: Thu Jan 19, 2006 8:25 am     Reply with quote

I wrote a c program to display keypad value in a certain format . there are two cases:
1>> when I press '.' then a value, say 7, lcd display '0.7V' or
2>> when I press '1' then a value, say 2, lcd dispaly '1.2V' .
I compile this c program well and connect to power supply, 'hello' is display but whatever i press the keypad , no data is display.
#include <16f877.h>
#include "c:\program files\picc\drivers\kbd.c"
#use delay(clock=4000000)
#include <lcd.c>
#fuses XT,NOWDT,NOPROTECT,NOLVP
char c,c1;

void main(void)
{
port_b_pullups(true);
kbd_init();
lcd_init();
lcd_putc('\f');
printf(lcd_putc,"hello");
while(1)
{
c = kbd_getc();
if(c!=0)
{
switch(c)
{
case '.': c1=kbd_getc();
if(c1!=0)
{
lcd_putc('\n');
printf(lcd_putc,"0.%cV",c1);}
break;
case '1': c2=kbd_getc();
if(c2!=0)
{
lcd_putc('\n');
printf(lcd_putc,"1.%cV",c2);
}
break;
}
}
}
}
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Thu Jan 19, 2006 9:25 pm     Reply with quote

What port is the LCD connected to ?

What port is the keypad connected to ?


Port B or Port D ?
lgeorge123



Joined: 05 Dec 2004
Posts: 31

View user's profile Send private message

DISPLAY KEYPAD VALUE TO LCD
PostPosted: Thu Jan 19, 2006 9:54 pm     Reply with quote

lcd to portb, keypad to portd
I sure both keypad and lcd hardware are functional well.
lgeorge123



Joined: 05 Dec 2004
Posts: 31

View user's profile Send private message

display keypad to lcd
PostPosted: Thu Jan 19, 2006 9:57 pm     Reply with quote

Sorry, lcd is to portd, keypad is to portb.
lgeorge123



Joined: 05 Dec 2004
Posts: 31

View user's profile Send private message

display keypad value to lcd
PostPosted: Thu Jan 19, 2006 10:03 pm     Reply with quote

I also write a simple to test the keypad working or not.
main()
{
port_b_pullups(true);
while(1)
{
c=kbd_getc();
if(c!=0)
{lcd_putc('\n');
lcd_putc(c);}
}
it display all value whatever I enter using the same hardware.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group