// https://wokwi.com/projects/422957716593624065
// https://forum.arduino.cc/t/randomize-rgb-led-colors/1354125

# include "RGBLed.h"

# define LED0 12, 11, 10
# define LED1 9, 8, 7
# define LED2 6, 5, 4
# define LED3 A0, 2, 3
# define LED4 A3, A2, A1

# define button1 A6
# define button2 A7

int myColor[][3] = {
// OFF
  {0, 0, 0},
// RED
  {255, 0, 0},
// GREEN
  {0, 255, 0},
// BLUE
  {0, 0, 255},
// CYAN
  {0, 255, 255},
// MAGENTA
  {255, 0, 255},
// YELLOW
  {255, 255, 0},
// WHITE
  {255, 255, 255},
};

const byte nColors = sizeof myColor / sizeof *myColor;
enum byName {Black, Red, Green, Blue, Cyan, Magenta, Yellow, White};
char *colorTags[] = {"off", "red", "green", "blue", "cyan", "magenta", "yellow", "white"};

RGBLed myRGBLedArray[] = {
  {LED0, RGBLed::COMMON_CATHODE},
  {LED1, RGBLed::COMMON_CATHODE},
  {LED2, RGBLed::COMMON_CATHODE},
  {LED3, RGBLed::COMMON_CATHODE},
  {LED4, RGBLed::COMMON_CATHODE},
};

const byte nLEDs = sizeof myRGBLedArray / sizeof *myRGBLedArray;

void setup() {
  Serial.begin(115200);
  Serial.println("\nWake Up!\n");

  pinMode(button1, INPUT);
  pinMode(button2, INPUT);
}

void loop() {
  int theLED = random(nLEDs);
  int theColor = random(nColors);

  Serial.print("Turn LED");
  Serial.print(theLED);
  Serial.print(" ");
  Serial.println(colorTags[theColor]);

  myRGBLedArray[theLED].setColor(myColor[theColor]);
  delay(1000 + random(500));
}

void loop0() {
  myRGBLedArray[0].setColor(myColor[White]);

  myRGBLedArray[1].setColor(myColor[Red]);
  myRGBLedArray[2].setColor(myColor[Green]);
  myRGBLedArray[3].setColor(myColor[Blue]);

  myRGBLedArray[4].setColor(myColor[Magenta]);
}
uno:A5.2
uno:A4.2
uno:AREF
uno:GND.1
uno:13
uno:12
uno:11
uno:10
uno:9
uno:8
uno:7
uno:6
uno:5
uno:4
uno:3
uno:2
uno:1
uno:0
uno:IOREF
uno:RESET
uno:3.3V
uno:5V
uno:GND.2
uno:GND.3
uno:VIN
uno:A0
uno:A1
uno:A2
uno:A3
uno:A4
uno:A5
rgb1:R
rgb1:COM
rgb1:G
rgb1:B
rgb2:R
rgb2:COM
rgb2:G
rgb2:B
rgb3:R
rgb3:COM
rgb3:G
rgb3:B
rgb4:R
rgb4:COM
rgb4:G
rgb4:B
rgb5:R
rgb5:COM
rgb5:G
rgb5:B
LED0
LED1
LED2
LED3
LED4