docs-content
docs-content copied to clipboard
Possible Typo In Documentation For Digital Pins
The documentation for digital pins has a special section regarding pin 13 behaving oddly when used as an input due to the attached LED and resistor.
NOTE: Digital pin 13 is harder to use as a digital input than the other digital pins because it has an LED and resistor attached to it that's soldered to the board on most boards. If you enable its internal 20k pull-up resistor, it will hang at around 1.7V instead of the expected 5V because the onboard LED and series resistor pull the voltage level down, meaning it always returns LOW. If you must use pin 13 as a digital input, set its pinMode() to INPUT and use an external pull down resistor.
I'm confused by the following line which doesn't make sense to me.
If you must use pin 13 as a digital input, set its pinMode() to INPUT and use an external pull down resistor.
If the pin mode was set to INPUT and nothing was driving it, it seems like the path to ground through the attached LED and resistor would lead to the pin consistently reading as low anyway, making the addition of a pull down resistor pointless (quick testing on an UNO R3 I have matches this expected behavior).
Was the documentation meant to instead say something along the lines of this instead?
If you must use pin 13 as a digital input with a pullup, set its pinMode() to INPUT and use an external pull up resistor.
(The addition of which would correctly result in the pin reading as high when nothing is driving it, despite the attached led and resistor)