#include <16f877.h>
#fuses XT,NOWDT,NOPROTECT,NOBROWNOUT,NOLVP,NOPUT,NOWRT,NODEBUG,NOCPD
#use delay (clock=4000000)
#use fast_io(b)
#use fast_io(d)
#define use_portb_lcd TRUE
#include <lcd.c>
void main()
{
int8 x,y;
int1 a,b;
setup_psp(PSP_DISABLED); // PSP birimi devre dışı
setup_timer_1(T1_DISABLED); // T1 zamanlayıcısı devre dışı
setup_timer_2(T2_DISABLED,0,1); // T2 zamanlayıcısı devre dışı
setup_adc_ports(NO_ANALOGS); // ANALOG giriş yok
setup_adc(ADC_OFF); // ADC birimi devre dışı
set_tris_b(0x00); // PORTB çıkış
set_tris_c(0xFF); // PORTD giriş
set_tris_d(0x00); // PORTD çıkış
lcd_init();
printf(lcd_putc,"\f");
lcd_gotoxy(1,1);
printf(lcd_putc,"Started...");
while(1)
{
x=y=0;
if (x && y) //Döngüye girmez...
{
printf(lcd_putc,"\f");
lcd_gotoxy(1,1);
printf(lcd_putc,"x=0 y=0");
lcd_gotoxy(1,2);
printf(lcd_putc,"in Loop");
}
x=y=1;
if (x && y) //Döngüye girer...
{
printf(lcd_putc,"\f");
lcd_gotoxy(1,1);
printf(lcd_putc,"x=1 y=1");
lcd_gotoxy(1,2);
printf(lcd_putc,"in Loop");
}
x=0;
y=1;
if (x && y) //Döngüye girmez...
{
printf(lcd_putc,"\f");
lcd_gotoxy(1,1);
printf(lcd_putc,"x=0 y=1");
lcd_gotoxy(1,2);
printf(lcd_putc,"in Loop");
}
x=1;
y=0;
if (x && y) //Döngüye girmez...
{
printf(lcd_putc,"\f");
lcd_gotoxy(1,1);
printf(lcd_putc,"x=1 y=0");
lcd_gotoxy(1,2);
printf(lcd_putc,"in Loop");
}
}
}