中国领先的工业平台

返回贤集网 返回微头条
贤集网技术微头条APP获取

启动 ESP-01 模块时,为什么连接到 GPIO...

 雨巷

下载贤集网APP入驻自媒体

启动 ESP-01 模块时,为什么连接到 GPIO-0 引脚的 LED1 会闪烁一次?即使写入高电平,怎么解决这个问题?感谢好心人抽时间回答。
代码:
const int BUTTON=2; const int LED=0 ; 
int BUTTONState=0; 
void setup() { // put your setup code here, to run once: //delay(1000); pinMode(LED,OUTPUT); pinMode(BUTTON,INPUT); digitalWrite(BUTTON,HIGH); // Have to write this pin high before entering the void loop otherwise this pin will be grounded } void loop() { // put your main code here, to run repeatedly: BUTTONState=digitalRead(BUTTON); if(BUTTONState==HIGH) { digitalWrite(LED,HIGH); } else { digitalWrite(LED,LOW); } }

最新回复

还没有人回复哦,抢沙发吧~

发布回复

为您推荐

热门交流