void setup()
{
Serial.begin(9600);
}
void loop()
{
if(Serial.available())
{
int index = 0;
char rfidArray[15];
while(Serial.available())
{
rfidArray[index] = Serial.read();
index++;
}
Serial.println(rfidArray);
for(int x = 0 ; x < 15 ; x++)
{
rfidArray[x] = 0;
}
}
}
I'm having a problem with that code. For some reason, every time the board resets, the first RFID read is a garbage string. I'd paste the output, but apparently that's not possible from the serial monitor.
All other reads are good, until I reset it again. Then, another garbage string before good results.
Is there something I can fix to prevent this, or do I need to code around it?