I have a ESP8266-01 and I want to use it to check if my door is open or not using GPIO0 or GPIO2 as input.
As GPIO0 and GPIO2 both needs to be high or floating at boot, I cannot directly connect my switch to either of it. The solution is that I connect the switch between GPIO0 and GPIO2 so that at boot-up both are high, and once the chip is booted, set GPIO0 as output and low. Now, if the switch is open, GPIO2 will read high and if it is close it'll read low. This is what I understand from the discussions and posts at several places.
But, I'm new and confused! :P
Can I connect GPIO0 and GPIO2 directly without anything else? No pull-ups, no resistors in between?
Is it okay to directly connect GPIO0 and GPIO2 with a wire at boot-up? And also when GPIO0 is output-low and GPIO2 is input?
As I understand, in output mode, GPIO is connected the with VCC or ground with very low resistance. What about input? How is it implemented? If I connect GPIO0's output to GPIO2's input, is there any chance of short-circuit?
When setting that up after boot, is there any specific sequence I should be setting GPIO0 and GPIO2 as output or input respectively? Does it matter?
From what I understand, the chip has internal pull-ups. But discussions around the web gives a very confusing idea about the need of external pull-up resistors. Are pull-up resistors needed to implement this?