Do you have Serial Monitor set to send a newline at then end of each line you send? The example code is expecting the newline.
Do you have Serial Monitor set to send a newline at then end of each line you send? The example code is expecting the newline.