Problems when comparing a String

Who told you to do this? It will block your code until something enters into the serial buffer.

  1. Ditch Strings and start using C-strings.
  2. Have a read of Serial Input Basics
  3. Use the strcmp function to compare 2 strings in an if statement
  4. here is a partial simulation for your example: serial input question - Wokwi ESP32, STM32, Arduino Simulator. type any of your 3 words in the serial monitor (enclosed in start "<" and end markers ">" ) and the word will get outputted to the serial monitor.

for example: type in <verde> and it will output This just in ... verde. Typing in anything that isn't one of the 3 words will output nothing.