for (i=0;i<21; i++)
{
ticket[i]=Serial1.read();
}
Perhaps you should check if serial data is available first? 21 bytes of it in this case.
for (i=0;i<21; i++)
{
ticket[i]=Serial1.read();
}
Perhaps you should check if serial data is available first? 21 bytes of it in this case.