25/06/2015
30
void
fadeOff(unsigned int
31
//change the brightness by FOR statement
32
for
(byte value = 255; value >0; value‐=decreament){
33
Serial.println(value);
34
analogWrite(ledPin, value);
35
delay(time/(255/5));
36
}
37
}
5.RGB LED
?
1
/*
2
RGB LED
3
*/
4
int
redPin = 9; // the pin that the red LED is attached to
5
int
greenPin = 10; // the pin that the green LED is attached to
6
int
bluePin = 11; // the pin that the blue LED is attached to
7
8
void
setup(){
9
pinMode(redPin, OUTPUT);
10
pinMode(greenPin, OUTPUT);
11
pinMode(bluePin, OUTPUT);
12
13
}
14
void
loop(){
http://www.dfrobot.com/wiki/index.php/DFRduino_Beginner_Kit_For_Arduino_V3_SKU:DFR0100
DFRduino Beginner Kit For Arduino V3 SKU:DFR0100 Robot Wiki
time,int
decreament){
7/23
Need help?
Do you have a question about the DFR0100 and is the answer not in the manual?
Questions and answers