下载贤集网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); } }