25/06/2015
DFRduino Beginner Kit For Arduino V3 SKU:DFR0100 Robot Wiki
http://www.dfrobot.com/wiki/index.php/DFRduino_Beginner_Kit_For_Arduino_V3_SKU:DFR0100
9/23
14
15
16
17
18
19
20
sinVal = (sin(x*(3.1412/180)));
// generate a frequency from the sin value
toneVal = 2000+(int(sinVal*1000));
tone(8, toneVal);
delay(2);
}
}
7.Temperature Alarm
?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/*
Temperature Alarm
*/
float
sinVal;
int
toneVal;
unsigned long
tepTimer ;
void
setup(){
pinMode(8, OUTPUT);
Serial.begin(9600);
}
void
loop(){
int
val;
double
data;
val=analogRead(0);