Change pinMode to SET_INPUT or SET_OUTPUT

Original code is using WRITE from fastio, but used pinMode to
set pin direction and did not use the fastio SET_INPUT or SET_OUTPUT.
This caused an issue with the rotary encoder interface to a  board based
on teensyduino (printrboard), since for teensyduino pin numbers for fastio and the
usual Arduino IO are different.