I am messing with some sets of neo pixel LED strings. I have the colors defind by their RGB values, I have RED, GREEN, YELLOW, BLUE, PURPLE, & ORANGE. I randomly select an LED# to assign a color to, but want to randomly pick from the colors listed above too. I cant figure that part out. Coworker said something like:
std::string Colors[6] = {“BLUE”,“GREEN”,“RED”,“YELLOW”,“ORANGE”,“PURPLE”};
int randomIndex = rand() % 3;
cout << "Random_Color " << Colors[randomIndex];
But I cant get it to work.
Any suggestions?
THanks