Hi, You're using Serial.write() instead of Serial.print(). Try using print to get ASCII coded output (write() returns a binary output). Additionally, if there's no data available at softSerial you'll get some random values at output.
Now I was trying to get the tag-bytes into a char. The following code displays the entire tag correctly in the Serial Monitor, but I do not seem to get it working to get that value into a char.
if (bytesRead == 12)
{
Serial.print("6-byte code: ");
for (i = 0; i < 6; i++)
{
if (code[i] < 16) Serial.print("0");
Serial.print(code[i], HEX);
}
Serial.println();
}
Even if I try Serial.print(code); or Serial.write(code); it does not work.
I know it is wrong and that's why, as I stated in my previous post, I started all over using the Playground's code.
So the 'is there any way to achieve this' was not meant for my first post, but the second.
So again, the question is;
Can I put the value of the code byte into a char in order to compare it with the hard-coded (a char array) allowed tags?