RGB-LED and 2x Momentary Switches 02
This program makes Arduino to read signals (on/off) from two momentary switches (it reads signals about every 50 milliseconds). The program then instruct Arduino to increase the light intensity of one of colours (RGB) of the RGB-LED according to the switch combination.
When any of RGB values exceeded ‘250’, it resets to ‘0’.
printRGB is a custom function to print RGB value to Serial Monitor.
rgbPattern is a custom function to change RGB value of RGB-LED. Try changing any of RGB values to see if you can find the colour you like.
"+=" adds the number that follows the sign to the preceding variable and store the result to the same variable. See Increment Compound in Arduino’s language reference for more information.