how to detect numbers from phone keypad?

Thread Starter

tuanvoi

Joined Oct 31, 2008
56
Hi all,
I'm using PIC18F4550. Could someone help me with this?
I want the PIC to detect the numbers the I press from the phone. Any sample codes or hints would be very appreciate. Thank you!
Tom
 
#include <16f877a.h>
#fuses hs,put,nowdt,NOPROTECT
#use delay (clock=20000000)
#use rs232(baud=9600,parity=n,bits=8, xmit=PIN_C6,rcv=PIN_C7)
#byte portc=7//virtual terminal
#byte kbd = 6
#include <kbd.c> //key pad driver file see in compiler folder(driver)
#include <LCD_1.c> //Lcd driver
unsigned int c;
void main (void){

set_tris_c(0b10000000);
portc=0;
kbd_init();
lcd_init();
lcd_putc('\f');

while(1){
c = kbd_getc();
if (c>0)
printf(lcd_putc,"\fNow %c Pressed ",c);
if(c>0)
printf("\f Now %c Pressed",c);
}//while
}//main
 
Top