欧美极品高清xxxxhd,国产日产欧美最新,无码AV国产东京热AV无码,国产精品人与动性XXX,国产传媒亚洲综合一区二区,四库影院永久国产精品,毛片免费免费高清视频,福利所导航夜趣136
標(biāo)題:
arduino聲音傳感器資料與程序
[打印本頁]
作者:
筱豆先生
時間:
2017-11-14 11:38
標(biāo)題:
arduino聲音傳感器資料與程序
聲音傳感器資料
0.png
(7.1 KB, 下載次數(shù): 88)
下載附件
2017-11-14 18:37 上傳
0.png
(31.28 KB, 下載次數(shù): 98)
下載附件
2017-11-14 18:37 上傳
arduino源程序如下:
int ledPins[] = {3,4,5,6,7,8,9,10};
int switchPin = 2;
int soundPin = 0;
boolean showPeak = false;
int peakValue = 0;
void setup()
{
for(int i = 0;i < 8; i++)
{
pinMode(ledPins[i],OUTPUT);
}
pinMode(switchPin,INPUT);
}
void loop()
{
if (digitalRead(switchPin))
{
showPeak = !showPeak;
peakValue = 0;
delay(200);
}
int value = analogRead(soundPin);
int topLED = map(value,0,400,0,12)-1;
if(topLED>peakValue)
{
peakValue = topLED;
}
for(int i = 0;i < 8;i++)
{
digitalWrite(ledPins[i],(i <= topLED||(showPeak && i == peakValue)));
}
}
復(fù)制代碼
所有資料51hei提供下載:
arduino聲音傳感器 模擬.rar
(211.57 KB, 下載次數(shù): 40)
2017-11-14 11:38 上傳
點(diǎn)擊文件名下載附件
下載積分: 黑幣 -5
歡迎光臨 (http://www.raoushi.com/bbs/)
Powered by Discuz! X3.1