User manual
IDUINO for Maker’s life
www.openplatform.cc
BLACK};
void setup(){
for(int i = 0; i < 3; i++){
pinMode(ledDigitalOne[i], OUTPUT); //Set the three LED pins as
outputs
}
}
void loop(){
/* Example - 1 Set a color
Set the three LEDs to any predefined color
*/
setColor(ledDigitalOne, YELLOW); //Set the color of LED one
/* Example - 2 Go through Random Colors
Set the LEDs to a random color
*/
//randomColor();
}
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