int cardone[16] = {
2,53,57,48,48,50,57,51,49,67,51,56,50,13,10,3};//stores the string id of rf tag one
int cardthree[16] = {
2,53,57,48,48,50,57,52,55,50,69,49,57,13,10,3};//stores the string id of rf tag three
int cardfour[16] = {
2,53,57,48,48,50,57,50,67,57,69,67,50,13,10,3};//stores the string id of rf tag four
int cardfive[16] = {
2,53,57,48,48,50,57,55,66,48,49,48,65,13,10,3};//stores the string id of rf tag five
int newcard [16] = {
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};//stores a new sting of same integers as tags but all set to 0
160 bytes gone, where only 80 need to be used. The tag data is byte, not int.
String line1;
String line2;
String line3;
String line4;
String line5;
Wrong. Learn to use c strings (NULL terminated arrays of chars). No wasting resources dynamically allocating/deallocating memory.
delay(100);//delay so all data is read
Absolutely, unequivocally, wrong!
There is no need to wait for "all the data" to arrive. If you think that it is, you might as well may this delay(4294967295) so that you can be absolutely certain.
for (int z=0; z<16; z++)//start at z=0 then add number for every number that comes in from tag
{
data=Serial.read();//input numbers from rf id and store into data
newcard[z] = data;// store number from data into array of z long in newcard
Serial.flush();//stops multiple reads
}
You know that there was one character to read. You hope that 15 more arrived while you were sitting on your thumbs. Then, you assume that that happened. Then, you block waiting for all sent data to be sent.
Do you see what is wrong with this picture?
switch (items)//case statment
This isn't a case statement. It isn't a for statement, an if statement, or a function call, either.
Most people can see what it is. Does an incorrect comment help?
String line1="Hienz";// store the text hienz in memory loaction line1
Creating local variables in a case statement is rarely a good idea. The variable goes out of scope at the end of the case statement.
How do cases 1, 2, and 3 differ from case 1?