RFID Program Help

I am trying to locate rfid chip. The program sorta works, it keeps reading and printing not found, found, not found, found etc. when the reader is away from the rfid chip. Then when hovering over the rfid chip, it keeps printing found, found, found - tell I move the reader away. It is doing the job, but I do not know why, I thought I would have had different result when I programmed this. Also led light does not come on as I programmed it too. Thank you so much!

Materials used: -Arduino Uno -Reader Id-20LA (125kHz)

-Arduino program
const int ledPin = 12;
const int ResetPin = 13;
#define dataIn 13

char tag1[13] = “TAG ID”;

void setup()
{
Serial.begin(9600);
pinMode(ResetPin, OUTPUT);
pinMode(ledPin, OUTPUT);
digitalWrite(ResetPin, HIGH);
}

void loop()
{
char tagString[dataIn];
int place = 0;
boolean reading = false;

while(Serial.available())
{
int byteRead = Serial.read();
Serial.println(“Tag found.”);
if(byteRead == 2) reading = true;
if(byteRead == 3) reading = false;
if(reading && byteRead != 2 && byteRead != 10 && byteRead != 13)
{
//Serial.println(“Tag located.”);
tagString[place] = byteRead;
place++;
}
}
checkTag(tagString);
clearTag(tagString);
readerReset();
}

void checkTag(char tag)
{
Serial.println(“Checking for tag data…”);
if(strlen(tag) == 0)
{
return;
}
if(compareTag(tag,tag1))
{
LED();
}
else
{
Serial.println(“New tag read:”);
Serial.println(tag);
delay(5000);
}
}

boolean compareTag(char array1, char array2)
{
Serial.println(“boolean”);
if(strlen(array1) == 0)
{
Serial.println(“false”);
return false;
}
for(int i=0; i < 12; i++)
{
if(array1 != array2*)*
* {*
* return false;*
* }*
* }*
* Serial.println(“Read valid tag.”);*
* return true;*
}
void LED()
{
* digitalWrite(ledPin, HIGH);*
* delay(350);*
* digitalWrite(ledPin, LOW);*
}
void clearTag(char array1[])
{
* //Serial.println(“C”);*
* for(int i=0; i < strlen(array1); i++)*
* {*
_ array1 = 0;
* }
}
void readerReset()
{
//Serial.println(“R”);
digitalWrite(ResetPin, LOW);
digitalWrite(ResetPin, HIGH);
delay(150);
}*_

you forgot to put the code in brackets so it was easier for us to read, but you you missed one example entry you needed to fill out with the tag number

char tag1[13] = "TAG ID"; should have your tag number.

so that this code would work

if(compareTag(tag,tag1)) { LED(); }

run the program once and you should see the result from Serial.println("New tag read:"); Serial.println(tag);

and then you should be able to copy the result to tag1