Microcontroller › AVR › copying rfid tag no in an array for comparision › hi frnds gud discussion going
hi frnds gud discussion going on
frnds i got a program of rfid system on which iam doing mini project
so frnds pls help in clearing my doubt…
frnds
> is the no. displayed on the tag v buy in rfid system is the only ID od that tag
> i think i hav a confined code which give access to only saperate TAG the program is shown below
#include<reg51.h>
sbit RS=P3^7;
sbit EN=P3^6;
sbit R=P3^2; // for relay
sbit bz=P1^7; // for piezo buzzer
void Rxmsg(void);
void lcdinit(void);
void lcdData(unsigned char l);
void lcdcmd(unsigned char k);
void DelayMs(unsigned int count);
void sucessRx(void);
void unknown(void);
void display(unsigned char s, t);
void welcome(void);
void main()
{
unsigned char i=0;
unsigned int j=0;
unsigned char c[15];
TMOD=0x20; // Configure the serial port to 9600 baud rate
TH1=0xFD;
SCON=0X50;
TR1=1;
R=0;
lcdinit();
welcome();
bz=1;
while(1)
{
back:
for(i=0;i<15;i++)
// command to recv data
{
c=0xFF;
}
while(RI==0);
for(i=0;i<15;i++) //command to recv data
{
j=0;
while(RI==0)
{
if(j>=1000)
goto timeout;
j++;
}
c=SBUF;
RI=0;
}
timeout:
for(i=0;i<15;i++)
{
if(c==’1′ && c[i+1]==’E’ && c[i+2]==’0′ && c[i+3]==’0′ && c[i+4]==’7′ && c[i+5]==’C’ && c[i+6]==’A’ && c[i+7]==’0′ && c[i+8]==’3′ && c[i+9]==’C’)
//RFID code
{
sucessRx();
DelayMs(1000);
R=1;
bz=0;
DelayMs(1000);
R=0;
bz=1;
DelayMs(1000);
lcdinit();
DelayMs(100);
welcome();
goto back;
}
}
unknown();
DelayMs(2000);
bz=0;
DelayMs(2000);
bz=1;
DelayMs(1000);
lcdinit();
DelayMs(100);
welcome();
}
}
void sucessRx()
{
unsigned int i=0;
unsigned char c[]=”ACCESS GRANTED “;
lcdcmd(0x01);
DelayMs(10);
lcdcmd(0x80);
DelayMs(10);
while(c!=’