When connecting a switch to an MCP23017, I usually insert a 200-300 R btwn switch and ground, to avoid shorting the pin if it was mistakenly programmed as output.
Question: is this good practice for switches connected directly to Arduino? Is it at all necessary? In other words: what happens if a pin programmed as output is switched directly to ground?
I have done a quick (probably too quick) search on the forum but not found an answer yet.
threegreens:
Question: is this good practice for switches connected directly to Arduino? Is it at all necessary? In other words: what happens if a pin programmed as output is switched directly to ground?
It may break due to too strong current.
There's supposedly a current limiter in the pins, but it's not guaranteed to have your pins survive what is effectively a short (either pin OUTPUT, HIGH connected to GND, or pin OUTPUT, LOW connected to Vcc).
Correct! I do that. Problem is not the code. I keep plugging and unplugging modules and it is not inconceivable that one day a connector will get on the wrong pins.