Page 2 of 2

Re: Code for GPIO ESP8266

PostPosted: Sun Jul 18, 2021 8:50 pm
by techstudycell
Hi, you can add the following lines in the void setup()

Code: Select allpinMode(D1, OUTPUT);
digitalWrite(D1, LOW);

Here, I have used the D1 (GPIO-5) as OUTPUT, if you use another GPIO pin then replace it with that.
For the INPUT add
Code: Select allpinMode(D1, INPUT);

Some GPIOs have limitations, if you make them HIGH or LOW during the booting process, the BOOT will fail.
You can refer to the following picture for that.

You can also refer to the following article
https://easyelectronicsproject.com/esp3 ... fi-manual/