Instructions

25/06/2015 DFRduinoBeginnerKitForArduinoV3SKU:DFR0100RobotWiki
http://www.dfrobot.com/wiki/index.php/DFRduino_Beginner_Kit_For_Arduino_V3_SKU:DFR0100 7/23
30
31
32
33
34
35
36
37
voidfadeOff(unsignedinttime,intdecreament){
//changethebrightnessbyFORstatement
for(bytevalue=255;value>0;value‐=decreament){
Serial.println(value);
analogWrite(ledPin,value);
delay(time/(255/5));
}
}
5.RGBLED
?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
/*
RGBLED
*/
intredPin=9;//thepinthattheredLEDisattachedto
intgreenPin=10;//thepinthatthegreenLEDisattachedto
intbluePin=11;//thepinthattheblueLEDisattachedto
voidsetup(){
pinMode(redPin,OUTPUT);
pinMode(greenPin,OUTPUT);
pinMode(bluePin,OUTPUT);
}
voidloop(){