RGB trouble

i copied this from you tube and watched his work but mine will not work, I had 3 com ports open but shut down IDE and thats was fixed. I restarted laptop, I checked i have CC RGB and wired it accordingly. can someone check this code.

once the code is loaded a serial monitor asks for the color.

rgb.ino (947 Bytes)

Please provide a detailed description of what you mean by "will not work".

nothing turns on, if i but red leg to 5 volts it goes red, so i know i have a common cathode LED. but when i upload the code and go to the serial monitor to tell the computer ( When is asks , why color do i want ) and i type in red or green or blue, nothing goes on.

i think its my HP laptop. I think its a serial com problem

Set the line ending menu at the bottom of Serial Monitor to "No line ending". If you have it set to any other setting, the line ending is added to the color name you entered, which will cause the code to not recognize it.

The best way to troubleshoot a problem like this is by adding Serial.println() calls at strategic locations in the code. This will show you what is happening in the program.


Working perfect, you just made a big step in my life to learn. Thank you

You’re welcome. I’m glad to hear it’s working now. Enjoy!