As i am doing project on this
RFID, PIC-16f877, 3 sensor for parking
const unsigned char card1[] = "1D00E4018971";
const unsigned char card2[] = "1A003E2C5850";
const unsigned char card3[] = "1A003E772A79";
void read_card_value_from_uart() // Rxing card_value from rfid
{
for(k=0; k<=13; k++)
{
read_card_value[k-1]=getch();
}
}
rxed card_value from rfid should be compared with card1,card2 , card3
if any one card matches with rxed value it should display the corresponding card user on lcd otherwise it should display as unautherisd user.
for this i wrote function as
void compare_cards()
{
if((strcmp(card1,read_card_value))==0)
{
lcd_clear();
lcd_goto(0);
lcd_puts("card1 user");
}
else if((strcmp(card2,read_card_value))==0)
{
lcd_clear();
lcd_goto(0);
lcd_puts("card2 user");
}
else if((strcmp(card3,read_card_value))==0)
{
lcd_clear();
lcd_goto(0);
lcd_puts("card3 user");
}
else
{
lcd_clear();
lcd_goto(0);
lcd_puts("Un-Autherised user");
}
}
for im getting o/p as "unautherised user".
plz check the function let me know.
Thanks
RFID, PIC-16f877, 3 sensor for parking
const unsigned char card1[] = "1D00E4018971";
const unsigned char card2[] = "1A003E2C5850";
const unsigned char card3[] = "1A003E772A79";
void read_card_value_from_uart() // Rxing card_value from rfid
{
for(k=0; k<=13; k++)
{
read_card_value[k-1]=getch();
}
}
rxed card_value from rfid should be compared with card1,card2 , card3
if any one card matches with rxed value it should display the corresponding card user on lcd otherwise it should display as unautherisd user.
for this i wrote function as
void compare_cards()
{
if((strcmp(card1,read_card_value))==0)
{
lcd_clear();
lcd_goto(0);
lcd_puts("card1 user");
}
else if((strcmp(card2,read_card_value))==0)
{
lcd_clear();
lcd_goto(0);
lcd_puts("card2 user");
}
else if((strcmp(card3,read_card_value))==0)
{
lcd_clear();
lcd_goto(0);
lcd_puts("card3 user");
}
else
{
lcd_clear();
lcd_goto(0);
lcd_puts("Un-Autherised user");
}
}
for im getting o/p as "unautherised user".
plz check the function let me know.
Thanks