Professional Documents
Culture Documents
#include<16F877A.h>
#fuses hs , nowdt
#include"lcd.c"
#include<string.h>
#define ir PIN_B7
int buf = 0 , i = 0 , j ;
char rcv = 0 ;
int price_ref ;
int16 total = 0 ;
/////////////////////////////////////////////////////////////////////////////////
if( cancel_flag == 1 )
lcd_putc("\fCANCEL SUCEED") ;
//printf(lcd_putc,"\nRs : %lu",total);
delay_ms(100);
//printf("%lu",total);
//delay_ms(1500);
flag = 0 ;
j=2;
cancel_count = 0 ;
else
// printf(lcd_putc,"\nRs : %lu",total);
delay_ms(100);
//printf("%lu",total);
delay_ms(1500);
flag = 0 ;
j=2;
///////////////////////////////////////////////////////////////////////////////////////////////
while( j < 2 )
k[i] = rf_data[j][i] ;
delay_ms(50);
if(!strcmp(*k,*rf))
printf(lcd_putc,"\fMatch") ;
price_estimating( price_ref ) ;
delay_ms(1500);
if(strcmp(*k,*rf))
{
j++;
price_ref++ ;
delay_ms(100);
//////////////////////////////////////////////////////////////////////////////////////
cancel_flag = 1 ;
while( j < 2 )
k[i] = rf_data[j][i] ;
delay_ms(50);
if(!strcmp(*k,*rf))
printf(lcd_putc,"\fMatch") ;
price_estimating( price_ref ) ;
delay_ms(1500);
if(strcmp(*k,*rf))
j++;
price_ref++ ;
delay_ms(100);
///////////////////////////////////////////////////////////////////////////////////////
void main()
enable_interrupts( global ) ;
enable_interrupts( int_rda ) ;
TRIS_B = 0xf0 ;
lcd_init() ;
lcd_putc("Booting........\nPls wait");
delay_ms(1500);
lcd_putc("\f WELCOME");
delay_ms(1500);
output_low(buzzer) ;
printf(lcd_putc,"%c",msg[i]);
delay_ms(150);
if(i==10)
lcd_putc("\n");
delay_ms(1500);
delay_ms(1500);
while( 1 )
output_low(buzzer) ;
printf(lcd_putc,"\fShow Ur RFID") ;
printf(lcd_putc,"\nRs : %lu",total);
delay_ms(500);
if(input(cancel_button))
cancel_count = 1 ;
lcd_putc("\fCANCEL MODE\n SELECTED");
delay_ms(1500);
delay_ms(1500);
output_high(buzzer) ;
delay_ms(500);
while( flag == 1 )
rf = rfid+8 ;
printf(lcd_putc,"\f%s",rf) ;
delay_ms(1500);
printf("%s\r",rf) ;
if( cancel_count == 1 )
printf(lcd_putc,"\f%s",rf) ;
printf("c%s\r",rf) ;
cancel(rf);
}
else
calculating( rf );
#int_rda
void isr()
char c ;
c = getc();
rcv = c ;
buf = 0 ;
else
rfid[buf] = c ;
flag = 1 ;
}
if( buf < 11 )
buf++ ;
clear_interrupt( int_rda ) ;