dattlara76
Junior Member level 2
Hi,
On startup ESP-01 MODULE, the LED1 connected at PIN GPIO-0 gets ONCE blink even writing HIGH
in void setup().
After that the code is working as expected (Button press LED1 OFF and release LED1 ON.
My question is why LED1 goes ONCE blink at POWER on the ESP-01. and how to resolve this issue?
Please suggest??
Tnx.
On startup ESP-01 MODULE, the LED1 connected at PIN GPIO-0 gets ONCE blink even writing HIGH
Code:
digitalWrite(BUTTON,HIGH); // Have to write this pin high before entering the void loop otherwise this pin will be grounded
After that the code is working as expected (Button press LED1 OFF and release LED1 ON.
My question is why LED1 goes ONCE blink at POWER on the ESP-01. and how to resolve this issue?
Code:
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);
}
}
Please suggest??
Tnx.