|
if(temperature>25)
{
int thisNote = 0;
while( thisNote < 8)
{
tone(8, melody[thisNote], duration);//第一個是輸出引腳,第二個是要發的聲調,第三個是持續時間的意思
delay(duration);
thisNote++; //
}
if (thisNote==8)
thisNote=0; //清零
digitalWrite(RED, HIGH);
digitalWrite(BLUE, LOW);
digitalWrite(GREEN, LOW);
}
|
-
-
基于arduino的溫度報警器.7z
2019-12-29 12:30 上傳
點擊文件名下載附件
下載積分: 黑幣 -5
21.07 KB, 下載次數: 11, 下載積分: 黑幣 -5
|