25/06/2015
15
// call the function to change the colors of LED randomly.
16
colorRGB(random(0,255),random(0,255),random(0,255)); //R:0‐255 G:0‐255 B:0‐255
17
delay(1000);
18
}
19
20
void
colorRGB(int
21
analogWrite(redPin,constrain(red,0,255));
22
analogWrite(greenPin,constrain(green,0,255));
23
analogWrite(bluePin,constrain(blue,0,255));
24
}
6.Alarm
?
1
/*
2
Alarm
3
*/
4
float
sinVal;
5
int
toneVal;
6
7
void
setup(){
8
pinMode(8, OUTPUT);
9
}
10
11
void
loop(){
12
for(int
x=0; x<180; x++){
13
// convert degrees to radians then obtain value
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
red, int
green, int
blue){
8/23
Need help?
Do you have a question about the DFR0100 and is the answer not in the manual?
Questions and answers