echo in > /sys/class/gpio/gpioN/direction #set the GPIO N to input echo out > /sys/class/gpio/gpioN/direction # set the GPIO N to output