Chat freely about anything...

User avatar
By jetblackstar
#24096 So obviously not everything is broken out on the 01 model. And gpio-2 is our trusty friend for gpio. But as I understand it most of the pins can be turned into gpio.
0 we have to be careful is pulled in the right direction on boot, but can it be used after for gpio? How about tx and RX? Of we aren't pulling gpio0 down for flashing can we safely use them for gpio?

Thanks in advance.
-jet
User avatar
By lethe
#24100 Both GPIO0 & GPIO2 must read high during startup. As long as you can meet this requirement, you can use them as regular GPIOs. If you use them as outputs, it's best to use them as sink.
TX/RX can be used as GPIO1/3, as long as you don't try to use UART afterwards. TX will of course strobe during boot, when the onchip bootloader sends its boot messages.
User avatar
By martinayotte
#24108 Yes, @lethe said it right :

lethe wrote:Both GPIO0 & GPIO2 must read high during startup. As long as you can meet this requirement, you can use them as regular GPIOs. If you use them as outputs, it's best to use them as sink.


As I said in some other threads, that it is so easy to add MCP23017 GPIOs Expander on ESP01 GPIO0/GPIO2 since I2C SDA/SCL requires also PullUps, it is the perfect match. Then, it give you 16 GPIOs (even more, 128 GPIOs, since you can attach up to 8 MCPs on the same bus), the Adafruit_MCP23017 library is working out-of-the-box (if I remember when I've added to my Sketch_Buffet months ago)