Considering the original sketch is 17,708 lines long. That is boiled down.
avr_fred:
The output ports are "quasi-bidirectional". Read the datasheet again. Your answer is in there.
Why even both typing something so useless? Obviously I have read it at least once (as evidenced in post #6).