Links
Arduino port registers
arduino.cc
Each port is controlled by three registers, which are also defined variables in the Arduino language. The
DDR
register determines whether the pin is anINPUT
orOUTPUT
. ThePORT
register controls whether the pin isHIGH
orLOW
, and thePIN
register reads the state ofINPUT
pins set to input withpinMode()
.
Only recently finally dug into this to grok how it works. Very handy, especially for size constraints or simultaneous pin actions.