PIC16F877A ile LCD TUŞ TAKIMI UYGULAMASI
/* KEYPAD ÜZERİNDEN GELEN SAYILARI LCD ÜZERİNDE GÖSTERME
CODE BY YAHYA KARALİ
*/
#include <16f877a.h>
#fuses xt, nowdt, noprotect, nobrownout, nolvp, noput, nowrt, nodebug, nocpd
#use delay(clock=4000000)
#use fast_io(c)
#use fast_io(b)
#include <lcd.c>
#byte portc=0x07
char const keys[]={1,2,3,0,4,5,6,0,7,8,9,0,10,0,12 };
int yaz ;
void main()
{
setup_psp(psp_disabled);
setup_timer_1(t1_disabled);
setup_timer_2(t2_disabled,0,1);
setup_adc_ports(no_analogs);
setup_adc(adc_off);
setup_ccp1(ccp_off);
setup_ccp2(ccp_off);
set_tris_b(0x01);
set_tris_c(0x0f);
set_tris_d(0x00);
ext_int_edge(h_to_l);
enable_interrupts(int_ext);
enable_interrupts(global);
output_d(0x00);
lcd_init();
lcd_send_byte(0,0x0d);
printf(lcd_putc," \f CCS C " );
delay_ms(500);
lcd_gotoxy(1,2);
while(1)
if (interrupt_active(int_ext))
{
clear_interrupt(int_ext);
yaz=keys[portc&0x0f];
printf(lcd_putc, "%d", yaz);
delay_ms(500);
}
}
Proje Dosyaları İNDİR