Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Categories > Micro Controllers


Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc.

Reply
 
Tools
Old 3rd November 2009, 08:37 AM   #1
Default Parking guiding system

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
laxmid is offline  
Old 3rd November 2009, 10:55 AM   #2
Default

That means your "read_card_value" doesn't read the card values properly.You can verify is your "read_card_value" gives the proper unique code by sending the "read_card_value" directly to the LCD without comparing.
__________________
Gayan

My Website
http://gsmicro.blogspot.com/
Gayan Soyza is offline  
Old 10th November 2009, 05:43 AM   #3
Default

Seems to implimented soon
seetha is offline  
Old 10th November 2009, 02:25 PM   #4
Default

Quote:
Originally Posted by laxmid View Post
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();
}

}

...
read_card_value[k-1]=getch();
Why are you doing this? On the first time through the loop you then have:
read_card_value[-1]=getch();
Just use:
Code:
void read_card_value_from_uart() { // Rxing card_value from rfid 

	for(k=0; k<=13; k++) {
		read_card_value[k]=getch();
	}
 
}
BeeBop is offline  
Old 10th November 2009, 04:02 PM   #5
Default

heh also your arrays are wrong:

Code:
const unsigned char card1[] = "1D00E4018971";
const unsigned char card2[] = "1A003E2C5850";
const unsigned char card3[] = "1A003E772A79";
Are supposed to be 13 byte arrays i assume...You are supposed to have 13 bytes in it now 13 characters like this would be it more or less but your missing bytes then:

Code:
const unsigned char card1[] = {0x1D,0x00,0xE4,0x01,0x89,0x71};
const unsigned char card2[] = {0x1A,0x00,0x3E,0x2C,0x58,0x50};
const unsigned char card3[] = {0x1A,0x00,0x3E,0x77,0x2A,0x79};
As you can see there is infact only 6 bytes in this... If the string is exact and contains those 13 characters you might mean this then:

Code:
const unsigned char card1[] = {0x01,0x0D,0x00,0x00,0x0E,0x04,0x00,0x01,0x08,0x09,0x07,0x01};
const unsigned char card2[] = {0x01,0x0A,0x00,0x00,0x03,0x0E,0x02,0x0C,0x05,0x08,0x05,0x00};
const unsigned char card3[] = {0x01,0x0A,0x00,0x00,0x03,0x0E,0x07,0x07,0x02,0x0A,0x07,0x09};

Last edited by AtomSoft; 10th November 2009 at 04:13 PM.
AtomSoft is offline  
Old 11th November 2009, 04:54 AM   #6
Default

Thanx to all for ur kind reply.

Actually "read_card_value" doesn't read the card values properly. Thats the i was getting 1st value its taking dummy then after 12 numbers its taking again 2 dummy variable. for that reason i was getting problem.
i have completed this project.

Thanks to all.
laxmid is offline  
Old 11th November 2009, 04:57 AM   #7
Default

If you know please tell me how to interface keyboard to pic16f877a?
n how it works?
as i am using 6-pin ps/2 connector. Please help me out as arly as posible.
Thanks in advance.
laxmid is offline  
Old 11th November 2009, 11:58 AM   #8
Default

PS/2 isnt hard nor easy heh. I have code somewhere on the forum for it.I need to redo a new one tho. Just to clean it up since i feel smarter now maybe i can make it better heh
AtomSoft is offline  
Reply

Tags
guiding, parking, system

Thread Tools
Display Modes


Similar
Title Starter Forum Replies Latest
Guiding Blind People Robot ''Robotic Cane'' modi88 Electronic Projects Design/Ideas/Reviews 0 3rd March 2009 05:18 PM
Parking Gate dreamproject Electronic Projects Design/Ideas/Reviews 4 15th November 2007 01:23 PM
Parking Access System abosseen Electronic Projects Design/Ideas/Reviews 5 18th March 2004 09:24 PM
help : parking lot system danae_fiz Electronic Projects Design/Ideas/Reviews 2 8th July 2003 10:49 AM
Offer:parking sensor and car alarm system Enjoy Electronic Projects Design/Ideas/Reviews 0 25th June 2003 07:54 AM



All times are GMT. The time now is 09:51 PM.


Electronic Circuits  |  Learning Electronics
eXTReMe Tracker