Closed GoogleCodeExporter closed 8 years ago
If this functionality is added, is the risk of someone unintentionally
en/disabling pullups with the old-style
"digitalWrite" method outweighed by the issues caused by eventually deprecating
and then removing that
approach?
Original comment by follower@gmail.com
on 7 May 2010 at 2:20
I've been hoping that the digitalWrite() functions can be made more efficient,
so adding a check that disables
them in input mode seems like the wrong way to go. Also, doing a
digitalWrite() while something is set as an
output (in a world where pullup() / noPullup() exist, and so you're not trying
to control the internal pullups)
seems like something that can be explained clearly: "digitalWrite() only works
properly when the pin is set as an
output".
Original comment by dmel...@gmail.com
on 7 May 2010 at 3:32
Why add additional API functions?
Why not simply add new mode options to the existing pinMode(pin, mode) function?
Simply add new modes like "INPUTPU" & "INPUTNPU" or whatever names you like,
then it is simply a small tweak to the pinMode() function in wiring_digital.c
to support the new input mode.
So:
input with pullups: pinMode(pin, INPUTPU);
input without pullups: pinMode(pin, INPUTNPU);
backward compability: pinMode(pin, INPUT); // default/current behavior
output: pinMode(pin, OUTPUT);
Seems a whole like cleaner and simpler than having to having to add new and
somewhat
parallel set of API mode functions.
It simplifies the API to 1 function to set pin modes.
Original comment by bperry...@gmail.com
on 11 May 2010 at 2:37
I think for new users (like me) adding this functionality could get confusing.
For now if I want to activate the pull-up resistor I need to use
digitalWrite(pin, HIGH). So when I look at my code I know my pin is high.
But if I where to use something like pullup(pin), I could easily forget that
this will not only activate the pull-up resistor but also make the pin HIGH.
Not a big thing......but for new users.....it could take a while to figure out
why this damn pin is always HIGH when I nowhere in my code used
digitalWrite(pin, HIGH)!
Not sure if my explanation is clear?
Original comment by bapcc...@gmail.com
on 23 Mar 2011 at 2:34
Original comment by dmel...@gmail.com
on 16 Dec 2011 at 10:06
Original comment by dmel...@gmail.com
on 2 Jan 2012 at 3:41
https://github.com/arduino/Arduino/commit/76c964d32b13f1fc01e3a5b07460d96f2dcaec
d6
Original comment by dmel...@gmail.com
on 2 Jan 2012 at 7:25
Original issue reported on code.google.com by
dmel...@gmail.com
on 6 May 2010 at 6:29