#include <abab.h>
#include <stdio.h>
#include <stdlib.h>
#use delay(clock=4M)
#FUSES NOWDT //No Watch Dog Timer
#FUSES XT //Crystal osc <= 4mhz for PCM/PCH , 3mhz to 10 mhz for PCD
#FUSES NOPUT //No Power Up Timer
#FUSES NOPROTECT //Code not protected from reading
#FUSES NODEBUG //No Debug mode for ICD
#FUSES NOBROWNOUT //No brownout reset
#FUSES NOLVP //No low voltage prgming, B3(PIC16) or B5(PIC18) used for I/O
#FUSES NOCPD //No EE protection
#FUSES NOWRT //Program memory not write protected
#FUSES RESERVED //Used to set the reserved FUSE bits
#FUSES NODEBUG
#include<lcd.c>
#use rs232(baud=9600,xmit=pin_c6,rcv=pin_c7,parity=N,stop=1)
#priority ext,rda
#int_ext
void ext_kesme(){
int y;
y=y+1;
if(y==1){
output_a(0b000000);
output_e(0b111);
}
if(y==2){
output_a(0b111001);
output_e(0b111);
printf(lcd_putc,"\f");
lcd_gotoxy(8,1);
printf(lcd_putc,"3");
}
if(y==3){
output_a(0b100100);
output_e(0b110);
}
if(y==4){
output_a(0b110000);
output_e(0b110);
}
if(y==5){
output_a(0b011001);
output_e(0b110);
}
if(y==6){
output_a(0b010010);
output_e(0b110);
}
if(y==7){
output_a(0b000010);
output_e(0b110);
}
if(y==8){
output_a(0b111000);
output_e(0b111);
}
if(y==9){
output_a(0b000000);
output_e(0b110);
}
if(y==10){
output_a(0b010000);
output_e(0b110);
y=0;
}
}
#int_rda
void rda_kesme(){
char t;
t=getc();
if(t=='0'){
output_a(0b000000);
output_e(0b111);
printf(lcd_putc,"\f");
lcd_gotoxy(8,1);
printf(lcd_putc,"0");
}
if(t=='1'){
output_a(0b111001);
output_e(0b111);
printf(lcd_putc,"\f");
lcd_gotoxy(8,1);
printf(lcd_putc,"1");
}
}
void main(){
lcd_init();
printf(lcd_putc,"HOSGELDIN BABA");
enable_interrupts(GLOBAL);
enable_interrupts(L_TO_H);
while(TRUE){
}
}