aarg:
Oops. Does this not fix the issue?:
No ![]()
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 ![]()
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