This simple project is taken from a YouTube tutorial that I've watched many times. It's just lighting an RGB LED via imput from the serial monitor. For some reason, the light will not light with any colour I type in. The baud rate is 112500. I recently updated to Big Sur, so maybe they're connected? I know the circuit is fine because I can easily to digitalWrite commands to get any of the colours to light. It's just trying to get the Serial.readString to work...
Hi, thanks for the quick reply! I'm at work, but will try that when I get home. I'll also try and post code that can be copied to the IDE so you can test it. Thanks again.
It would be good to add these two lines after the myColour = Serial.readString();
They will allow your compares to work even if someone accidentally adds a space before or after or accidentally types in upper or mixed case.
myColour.trim(); // Remove leading and trailing spaces
myColour.toLowerCase();
Thanks! I'm still very new to this. I guess your idea is much easier than adding multiple cases of the same answer:
if (myColour=="red") || (myColour=="RED") || (myColour=="Red")
etc.
After all that fuss, it was the "no line ending" on the serial screen. Thank you so much for your insight. I was driving myself crazy for 2 days trying to figure this out!