Instructions

IDUINO for maker’s life
46 www.openplatform.cc
void randomColor(){
int rand = random(0, sizeof(COLORS) / 2); //get a random number within
the range of colors
setColor(ledDigitalOne, COLORS[rand]); //Set the color of led one to a
random color
delay(1000);
}
/* Sets an led to any color
led - a three element array defining the three color pins (led[0] =
redPin, led[1] = greenPin, led[2] = bluePin)
color - a three element boolean array (color[0] = red value (LOW = on,
HIGH = off), color[1] = green value, color[2] =blue value)
*/
void setColor(int* led, boolean* color){
for(int i = 0; i < 3; i++){
digitalWrite(led[i], color[i]);
}
}
/* A version of setColor that allows for using const boolean colors
*/
void setColor(int* led, const boolean* color){
boolean tempColor[] = {color[0], color[1], color[2]};
setColor(led, tempColor);
}
********Code End********