Hi everyone,
I have been using Arduino and writing the code for it for a long time, but I am not an expert coder by any means.
I have a midi controller that has a lot of RGB LEDs in it and I control them with incoming MIDI messages. I have all this figured out and it works.
There are 17 RGB LEDs, To change colors I have this line in my code, with four numerical values:
keysRGB.setLED(1, 2, 3, 4);
The first value is the LED number and the 2, 3, 4 values are RGB values. I am going to implement 10 different colors and I would like them to be global and just listed in the code once, in case I want to add colors or change color values.
Would there be a way to have this in the code:
keysRGB.setLED(1, PURPLE);
keysRGB.setLED(1, RED);
keysRGB.setLED(1, BLUE); etc, Where RED would be variable with three values like: 255, 0, 0 ?
If this is possible how would I implement it? i was looking at a switch case, but I don't really know how to use that.
Thanks.