Hi all,
the ESP32 mostly need set: pinMode(pinA, INPUT); / pinMode(pinB, INPUT); , my question is if I don't set this way for some pins like pinC or pinD, do them certainly not work? or maybe work some time?
anyway to not let them work for the pins without set?
or is it ok to rename the button in later section of the code? say first named pinA= 2; later on rename: pinC = 2, physically , there is just one button on pin2.
Typically, pins are INPUT by default so any pin which you did not define should be in the default INPUT mode.
The chip doesn't care what variables point to which pins so it is ok to say pinA=2, pinB=2, or whatever. Also, you may start off with pinMode(2,INPUT) and change it to pinMode(2,OUTPUT) later.
It is not possible to have pins "not work". Typically pins that are to remain dormant are simply set to INPUT, thus the default.