Added setDirection functionality

Hi,

I just implemented this functionality to switch a pin on the fly from input to output and vice-versa.
This is really important to use the Tri-State-Pins of the raspberry pi as real Tri-State Pins ;) 

so long,
Tobias