def set_pin_mode pin, mode
			if ( @pin_modes >> ( pin - 1 )).odd?  && ( mode == :input  ) or
			   ( @pin_modes >> ( pin - 1 )).even? && ( mode == :output ) then

				mask = 0 + ( 1 << ( pin - 1 ))
				@pin_modes ^= mask
			end
		end
def set_pin_mode pin, mode
			if ( @pin_modes >> ( pin - 1 )).odd?  && ( mode == :input  ) or
			   ( @pin_modes >> ( pin - 1 )).even? && ( mode == :output ) then

				mask = 0 + ( 1 << ( pin - 1 ))
				@pin_modes ^= mask
			end
		end
Sets the mode of a GPIO pin to input or output.

 @param pin [Integer] ID of GPIO pin.
 @param mode [Symbol] :input or :output