1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
/****************************************************************************
ArSid Blink3
Turns on the LCD Backlight RGB-LED on for a while,
then off , repeatedly.
Pattern: R - G - B - - -
*****************************************************************************/
int ledR = 13;
int ledG = 12;
int ledB = 11;
void setup()
{ // put your setup code here, to run once:
pinMode (ledR, OUTPUT);
pinMode (ledG, OUTPUT);
pinMode (ledB, OUTPUT);
}
void loop()
{ // put your main code here, to run repeatedly:
digitalWrite(ledR, LOW); // turn the LED off by making the voltage LOW
delay( 500); // wait some time
digitalWrite(ledR, HIGH); // turn the LED on (HIGH is the voltage level)
delay( 500); // wait some time
digitalWrite(ledG, LOW); // turn the LED off by making the voltage LOW
delay( 500); // wait some time
digitalWrite(ledG, HIGH); // turn the LED on (HIGH is the voltage level)
delay( 500); // wait some time
digitalWrite(ledB, LOW); // turn the LED off by making the voltage LOW
delay( 500); // wait some time
digitalWrite(ledB, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1500); // wait some time
}
|