def set_mode(mode)
      raise UnsupportedModeError unless @onboard_pin.supported_modes.include?(mode)
      @board.set_pin_mode(@number, mode) unless current_mode == mode
    end
def set_mode(mode)
      raise UnsupportedModeError unless @onboard_pin.supported_modes.include?(mode)
      @board.set_pin_mode(@number, mode) unless current_mode == mode
    end
Public: Set the pin mode.

 mode - an Integer mode.

 Returns nothing.
 Raises UnsupportedModeError if the pin does not support the mode.