User manual

IDUINO for Maker’s life
www.openplatform.cc
Example
In this example, we blink a LED and using an RGB LED we can generate any color we
want.
Wire connection as below,
“V”-----------5V
R-------------------D10
“G”-------------------D11
“B”-------------------D9
********Code begin********
int ledDigitalOne[] = {10, 11, 9};
//10 = redPin, 11 = greenPin, 9 = bluePin
const boolean ON = HIGH;
const boolean OFF = LOW;
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};
const boolean* COLORS[] = {RED, GREEN, BLUE, YELLOW, CYAN, MAGENTA, WHITE, BLACK};
void setup(){
for(int i = 0; i < 3; i++){
pinMode(ledDigitalOne[i], OUTPUT);
}
}
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);
}