- Fri May 18, 2018 3:35 am
#199235
I have 5 RFID tags (in the final version there will be up to 50 RFID tags). Each of these TAGS reports multiple times. i need an output after scanning, each found TAG once.
Possibly the best solution to uniquely identify each TAG. Create a 2 dimensional array. The first dimension will be a counter, the second dimension will be the (for now) EPC (later TID & EPC). A loop checks whether the TAG is already contained in the array, if not it is added.
The Arduino uno has only 2KB SDRAM. What is the most effective way to create the 2 dimensional array, wich requires the least memory?
I use code form Example 1 - Constant Read
1. is a 2 dimensional array the best way to get each Tag once after a loop check?
2. What is the most effective way to create the 2 dimensional array, wich type requires the least memory?
3. Is nano.msg an array? When yes, what type is the array?
3. Why i get the error: invalid types 'byte {aka unsigned char}[int]' for array subscript?
Possibly the best solution to uniquely identify each TAG. Create a 2 dimensional array. The first dimension will be a counter, the second dimension will be the (for now) EPC (later TID & EPC). A loop checks whether the TAG is already contained in the array, if not it is added.
The Arduino uno has only 2KB SDRAM. What is the most effective way to create the 2 dimensional array, wich requires the least memory?
I use code form Example 1 - Constant Read
Code: Select all
This gives me following Serial monitor output
//Print EPC bytes, this is a subsection of bytes from the response/msg array
Serial.print(F(" epc["));
for (byte x = 0 ; x < tagEPCBytes ; x++)
{
if (nano.msg[31 + x] < 0x10) Serial.print(F("0")); //Pretty print
Serial.print(nano.msg[31 + x], HEX);
Serial.print(F(" "));
}
Serial.print(F("]"));
Code: Select all
As far as I can see, nano.msg is an array. But what type is the array? If I create the following arrayepc[E2 00 00 17 22 0A 00 51 14 70 7F BD]
epc[E2 00 00 17 22 0A 00 38 14 70 7F 97]
epc[E2 00 00 17 22 0A 00 71 14 70 7F DF]
epc[E2 00 00 17 22 0A 00 38 14 70 7F 97]
epc[E2 00 00 17 22 0A 00 37 14 70 7F 9E]
epc[E2 00 00 17 22 0A 00 71 14 70 7F DF]
epc[E2 00 00 17 22 0A 00 71 14 70 7F DF]
Code: Select all
I get the following error
byte tagEPCBytes[5][12];
Code: Select all
I try to save the data from tagEPCBytes[counter][x] = nano.msg[31 + x];
error: invalid types 'byte {aka unsigned char}[int]' for array subscript
tagEPCBytes[counter][x] = nano.msg[31 + x];
Code: Select all
I need help with following questions for (byte x = 0 ; x < tagEPCBytes ; x++)
{
tagEPCBytes[counter][x] = nano.msg[31 + x];
Serial.print(nano.msg[31 + x]);
Serial.print(F(" "));
}
Serial.print(F("]"))
1. is a 2 dimensional array the best way to get each Tag once after a loop check?
2. What is the most effective way to create the 2 dimensional array, wich type requires the least memory?
3. Is nano.msg an array? When yes, what type is the array?
3. Why i get the error: invalid types 'byte {aka unsigned char}[int]' for array subscript?