I feel like I should have a resistor between 3.3V, a swtich and digitalRead(D0) but it works fine without the resistor. Am I making a mistake? Why is it OK?
Is it true for all the Photon GPIO pins that direct 3.3V can be read as an input or do some have circuit protection and some don’t?
One thing not mentioned yet (directly) is that the GPIOs when set as INPUT are Hi-Z terminals, which will virtually not draw any current, so no risk to damage the GPIO by exceeding the max current limit.
BUT, exactly that near-zero current is also the reason why a resistor in series with a voltage source exceeding the max. voltage limit will not protect you against damaging the GPIO since you won’t see “any” voltage drop across the resistor which in turn means that you will have the same (too high) voltage on both sides of your “protective” resistor still frying the GPIO.
In case of INPUT_PULLUP/INPUT_PULLDOWN you’ll see some current across the 40k pull-resistors tho’
B2 and C5 are they just examples or actual pin numbers? The rest in your example make sense except I have never heard of BTN but it does compile and is pin number 20. What is it and is that the last one or are there a few more?
This begs the question: Why does the RST pin not have a pin number?
Also, if we wanted to push the Mode and Reset buttons at the same time would we have to physically connect the reset pin to a digital write and set it high while activating SETUP/MODE button?
Because it's not a GPIO but only a hardwired reset pin.
If you want to achieve what the reset pin does, just call System.reset(), why use a GPIO to set a signal outside of the device to loop it back into the device?
That would be like sending yourself a mail to check your inbox
@ScruffR, the only value of external hard reset is that it also hard resets all other devices (wifi/GSM). Software reset doesn’t quite have the same effect.
Hmm, while the actual use for the RESET pin is clear to me and doesn’t exactly apply to the asked question of how to “simulate” a RESET/SETUP combo, I’m not convinced the reset actually also affects the GSM module (keep alive and network connection survive a button reset too).