seperate getInput and getOutput; add toggle() for Gpio