A theoretical question


hi,
i wondering why have use pinmode declaration in sketches. if use analogwrite or digitalwrite command specific pin, doesn't imply particular pin output? , if use read versions of similar command, doesn't imply opposite?

thanks

quote
doesn't imply particular pin output?

using analogwrite(), yes. using digitalwrite(), no. might turning pullup resistor on input pin.

quote
and if use read versions of similar command, doesn't imply opposite?

pins default input, read works without need use pinmode(). in fact, though, can read state of output pin. so, digitalread() rells nothing state of pin.


Arduino Forum > Using Arduino > Programming Questions > A theoretical question


arduino

Comments

Popular posts from this blog

VIDIOC_S_FMT error 16, Device or resource busy - Raspberry Pi Forums

using a laptop skeleton to build a pi laptop - Raspberry Pi Forums

Forum for Joomla? - Joomla! Forum - community, help and support