This is what happens:
First you read the Serial buffer, and if it is 'A' you read it again, only problem is: now the buffer is empty. And thus, it returns -1.
![]()
This is what happens:
First you read the Serial buffer, and if it is 'A' you read it again, only problem is: now the buffer is empty. And thus, it returns -1.
![]()