def set_output pin, state
			state = false if state == :low
			state = true  if state == :high

			if ( @pin_states >> ( pin - 1 )).odd? && ( state == false ) or
			   ( @pin_states >> ( pin - 1 )).even? && ( state == true ) then

				mask = 0 + ( 1 << ( pin - 1 ))
				@pin_states ^= mask
			end
			
			write_output
		end
def set_output pin, state
			state = false if state == :low
			state = true  if state == :high

			if ( @pin_states >> ( pin - 1 )).odd? && ( state == false ) or
			   ( @pin_states >> ( pin - 1 )).even? && ( state == true ) then

				mask = 0 + ( 1 << ( pin - 1 ))
				@pin_states ^= mask
			end
			
			write_output
		end
Sets the state of a GPIO pin.

 @param pin [Integer] ID of GPIO pin.
 @param state [Boolean] State to set pin to. True == :high