基于arduino使蜂鸣器发声
3
2021-10-20
环境准备
安装arduino:https://www.arduino.cc/en/software 默认不支持Wemos,要去安装Wemos支持,进入设置,附加开发板URL:Additional Board Manager URLs: https://arduino.esp8266.com/stable/package_esp8266com_index.json
下载安装相关支持:开发板管理中搜索esp8266安装



代码:
void setup() { // put your setup code here, to run once: pinMode(D5,OUTPUT); //设置引脚为输出引脚 } void loop() { digitalWrite(D5,LOW); delay(1000); //毫秒 digitalWrite(D5,HIGH); delay(1000); //间隔蜂鸣 // put your main code here, to run repeatedly: }
烧录

- 0
-
分享