Opis
Modul z eno RGB LED diodo.
/*
* connect blue to pin 8
* connect red to pin 9
* connect green to pin 10
*/
//
const int blue = 8;
const int red = 9;
const int green = 10;
int timer = 250;
//
void setup() {
pinMode(blue, OUTPUT);//set blue as an output
pinMode(red, OUTPUT);//set red as an output
pinMode(green, OUTPUT);//set green as an output
}
//
void loop() {
digitalWrite(blue,HIGH);//color sequence for cycling through blue, red, green. One at a time.
delay(timer);
digitalWrite(blue,LOW);
delay(timer);
digitalWrite(red,HIGH);
delay(timer);
digitalWrite(red, LOW);
delay(timer);
digitalWrite(green, HIGH);
delay(timer);
digitalWrite(green, LOW);
delay(timer);
//
digitalWrite(blue, HIGH);//color sequence for purple
digitalWrite(red, HIGH);
digitalWrite(green, LOW);
delay(timer);
//
digitalWrite(blue, HIGH);//color sequence for turquoise
digitalWrite(green, HIGH);
digitalWrite(red, LOW);
delay(timer);
}