IDUINO for maker’s life
www.openplatform.cc 45
const boolean OFF = LOW; //Define off as HIGH
//Predefined Colors
const boolean RED[] = {ON, OFF, OFF};
const boolean GREEN[] = {OFF, ON, OFF};
const boolean BLUE[] = {OFF, OFF, ON};
const boolean YELLOW[] = {ON, ON, OFF};
const boolean CYAN[] = {OFF, ON, ON};
const boolean MAGENTA[] = {ON, OFF, ON};
const boolean WHITE[] = {ON, ON, ON};
const boolean BLACK[] = {OFF, OFF, OFF};
//An Array that stores the predefined colors (allows us to later randomly
display a color)
const boolean* COLORS[] = {RED, GREEN, BLUE, YELLOW, CYAN, MAGENTA, WHITE,
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();
}