|
Post by 邱老师 on Jan 2, 2021 11:41:19 GMT
通过调节电位器影响蜂鸣器的鸣响频率。 接线:D9接到开发板的B1插座,A0接到W3可变电阻插座 链接:https://pan.baidu.com/s/1MBd10PpeXpl48rP0dGIY8Q 提取码:57yx void setup() {
Serial.begin(9600);
}
void loop() {
// read the sensor:
int sensorReading = analogRead(A0);
// print the sensor reading so you know its range
Serial.println(sensorReading);
int thisPitch = map(sensorReading, 400, 1000, 120, 1500);
tone(9, thisPitch, 10);
delay(1); // delay in between reads for stability
}
|
|
马琰
New Member
Posts: 12
|
Post by 马琰 on Jan 9, 2021 7:49:07 GMT
会了
|
|
林明轩
Junior Member
Posts: 87
|
Post by 林明轩 on Jan 10, 2021 7:10:05 GMT
ye会了,感觉好无聊
|
|
林明轩
Junior Member
Posts: 87
|
Post by 林明轩 on Jan 10, 2021 7:11:52 GMT
迪迦
|
|
周佳祺
New Member
Posts: 32
|
Post by 周佳祺 on Jan 10, 2021 7:17:24 GMT
周佳祺完成,把声音放大100倍,应该就是消防车的警笛吧。
|
|
翁锐喆
New Member
Posts: 13
|
Post by 翁锐喆 on Jan 10, 2021 7:17:33 GMT
完成
|
|
蔡睿杰
New Member
Posts: 22
|
Post by 蔡睿杰 on Jan 10, 2021 7:18:21 GMT
完成了,跟面包板有点像
|
|
滕祠
Junior Member
Posts: 76
|
Post by 滕祠 on Jan 10, 2021 7:26:37 GMT
|
|
潘锦轩
New Member
Posts: 14
|
Post by 潘锦轩 on Jan 10, 2021 7:31:22 GMT
完成
|
|
徐晨涛
New Member
Posts: 29
|
Post by 徐晨涛 on Jan 10, 2021 7:32:50 GMT
完成
|
|
|
Post by 王骞 on Jan 10, 2021 7:34:40 GMT
完成
|
|
叶子郑茂
New Member
Posts: 13
|
Post by 叶子郑茂 on Jan 10, 2021 7:45:28 GMT
完成!!!
|
|
徐晨涛
New Member
Posts: 29
|
Post by 徐晨涛 on Jan 10, 2021 7:45:40 GMT
冲啊
|
|
毛显棋
Junior Member
王骞是傻逼SBSBSBSBSBBSBSB
Posts: 80
|
Post by 毛显棋 on Jan 10, 2021 7:58:46 GMT
完成
|
|
毛显棋
Junior Member
王骞是傻逼SBSBSBSBSBBSBSB
Posts: 80
|
Post by 毛显棋 on Jan 10, 2021 8:01:31 GMT
完成
|
|