Reading Mixed Serial If/Else ? ?

aarg:
Oops. Does this not fix the issue?:

No :slight_smile:

try typing "OOK\r\n"

your code sees the first O, it's a match at index 0 so index goes to 1
then your code sees the second O, it's not a match so index goes back to 0
then your code sees the K, it's not a match as you are waiting for 'O' your index stays at 0 and you blew it :slight_smile:

Now before you say "oh i need to check against the first one again"... no, won't work. Consider you are waiting for $$$123 and I type $$$$$$$123

see the issue? you need a memory of what has been entered