I agree with @red_car and some good robust ways are shown in Robin2's serial input basics tutorial.
You should see if there is data available in the serial receive buffer before you read from it.
I agree with @red_car and some good robust ways are shown in Robin2's serial input basics tutorial.
You should see if there is data available in the serial receive buffer before you read from it.