Changed default pin mode to INPUT (as the Arduino), and changed PE::setMode(..) to only call pinMode() if the mode actually changed.