arduino with rfid reader rdm6300

I am using the following code and it does work. That code has some of the same unpredictable results I was experiencing sort of a “stacking” phenomenon, If you hold the tag for just the right amount of time it’s ok… But that’s not going to happen too often.

Serial Ready
RFID Ready

Tag ID:
Msg Length: 1
0
Tag ID: 0
Msg Length: 2
0
Tag ID: 00
Msg Length: 3
3
Tag ID: 003
Msg Length: 4
C
Tag ID: 003C
Msg Length: 5
3
Tag ID: 003C3
Msg Length: 6
4
Tag ID: 003C34
Msg Length: 7
E
Tag ID: 003C34E
Msg Length: 8
B
Tag ID: 003C34EB
Msg Length: 9
1
Tag ID: 003C34EB1
Msg Length: 10
5
Tag ID: 003C34EB15
Msg Length: 11
F
Tag ID: 003C34EB15F
Msg Length: 12
6
Tag ID: 003C34EB15F6
Msg Length: 13

Tag ID: 003C34EB15F6
Msg Length: 14

Tag ID: 003C34EB15F6
Msg Length: 15
0
Tag ID: 003C34EB15F60
Msg Length: 16
0
Tag ID: 003C34EB15F600
Msg Length: 17
3
Tag ID: 003C34EB15F6003
Msg Length: 18
C
Tag ID: 003C34EB15F6003C
Msg Length: 19
3
Tag ID: 003C34EB15F6003C3
Msg Length: 20
4
Tag ID: 003C34EB15F6003C34
Msg Length: 21
E
Tag ID: 003C34EB15F6003C34E

It goes on, and on but you get the picture.CODE IS GIVEN BELOW!!! HOPE anyone can help me

#include <SoftwareSerial.h>

#define ADD_TAG_CODE “13009EB03904” //change this ID with your own card TAG
#define DEL_TAG_CODE “13009E743BC2” //change this ID with your own card TAG

SoftwareSerial rfid = SoftwareSerial(2, 3);
String msg;
String ID ; //string to store allowed cards

void setup()
{
Serial.begin(9600);
Serial.println(“Serial Ready”);

rfid.begin(9600);
Serial.println(“RFID Ready”);
}

char c;

void loop(){

while(rfid.available()>0){
c=rfid.read();
msg += c;
Serial.println(msg);
Serial.println(msg.length());
}
msg=msg.substring(1,13);
if(msg.indexOf(ADD_TAG_CODE)>=0) add();
else if(msg.indexOf(DEL_TAG_CODE)>=0) del();
else if(msg.length()>10) verifica();
msg="";

}

void add(){
Serial.print(“What TAG do you wanna grant access?: “);
msg=””;
delay(1000);
while(msg.length()<13){
while(rfid.available()>0){
c=rfid.read();
msg += c;
}
}
if(ID.indexOf(msg)>=0) {
Serial.println("\nAccess already granted for this card.");
msg="";
delay(1000);
}
else{
Serial.print("Card: ");
Serial.println(msg);
ID += msg;
ID += “,”;
//Serial.print(“ID: “);
// Serial.println(ID);
msg=””;
Serial.println(“Access granted for this card.”);
}

}

void del(){
msg="";
Serial.print(“What TAG do you wanna deny access?: “);
while(msg.length()<13){
while(rfid.available()>0){
c=rfid.read();
msg += c;
}
}
msg=msg.substring(1,13);
if(ID.indexOf(msg)>=0){
Serial.println(msg);
Serial.println(“TAG found. Access for this card denied.”);
//ID.replace(card,””);
int pos=ID.indexOf(msg);
msg="";
msg += ID.substring(0,pos);
msg += ID.substring(pos+15,ID.length());
ID="";
ID += msg;
//Serial.print(“ID: “);
//Serial.println(ID);
} else Serial.println(”\nTAG not found or already denied”);
msg=“yo Yo honey singh”;
}

void verifica(){
msg=msg.substring(1,13);
if(ID.indexOf(msg)>=0) Serial.println(“Access granted.”);

else Serial.println(“Access denied.”);
}

CODE IS GIVEN BELOW!!!!!

IMPROPERLY!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Screaming isn't very useful, is it? All that stupid punctuation isn't either, is it?

Now, fix the way you posted your code.

Use the # option and place your code between [] and [] text parts . :)