I used example 1 continuous reading. Add in loop () after printing the EPC bytes, the following: ```
MatchEPC(tagEPCBytes);
and add the following code in the sketch :
#define EPC_LENGTH 4 // use the last 4 digits
#define MAX_LIST 11 // maximum number of names / epc + 1
typedef struct
{
uint8_t epc[EPC_LENGTH];
String name;
} match;
// enter the last 4 digits of the EPC and the name
// as per examples
match matchlist[MAX_LIST] = {
{{0x15,0x40,0x80,0x29}, “Paul”},
{{0x10,0x41,0x67,0x09}, “soo031919”},
{{0x0,0x0,0x0,0x0},“end”} //THIS MUST ALWAYS BE THE LAST ENTRY
};
void MatchEPC(byte EPCBytes)
{
byte i, x = 0, MatchCount;
while (x < MAX_LIST)
{
// end of matchlist?
if (matchlist.name.equals(“end”)) break;
MatchCount = 0;
// look for match
for (i = 0; i < EPC_LENGTH ; i++) {
if(matchlist[x].epc[i] == nano.msg[31 + i + EPCBytes -EPC_LENGTH])
MatchCount++;
else
break;
}
// complete match ?
if (MatchCount == EPC_LENGTH){
Serial.print("found : ");
Serial.println(matchlist[x].name);
return;
}
// next entry in matchlist
x++;
}
// ooho…
Serial.print(“Could not find EPC ending on: “);
for (i = 0; i < EPC_LENGTH ; i++) {
if (nano.msg[31 + i + EPCBytes -EPC_LENGTH] < 0x10) Serial.print(F(“0”)); //Pretty print
Serial.print(nano.msg[31 + i + EPCBytes -EPC_LENGTH],HEX);
Serial.print(” “);
}
Serial.println(”\nMake sure to add in matchlist.”);
}