def normalize_motor_port port, accept_all=false
      @portmap ||= { a: byte(0),
                     b: byte(1),
                     c: byte(2),
                     all: byte(0xff),
      }
      raise ArgumentError.new("You cannot specify :all for this port") if port == :all and !accept_all
      raise ArgumentError.new("Motor ports must be #{@portmap.keys.inspect}: got #{port.inspect}") unless @portmap.include? port
      @portmap[port]
    end
def normalize_motor_port port, accept_all=false
      @portmap ||= { a: byte(0),
                     b: byte(1),
                     c: byte(2),
                     all: byte(0xff),
      }
      raise ArgumentError.new("You cannot specify :all for this port") if port == :all and !accept_all
      raise ArgumentError.new("Motor ports must be #{@portmap.keys.inspect}: got #{port.inspect}") unless @portmap.include? port
      @portmap[port]
    end
Converts a port symbol into the appropriate byte().

 @param [Symbol] port It should be `:a`, `:b`, `:c`, or `:all` (which correspond to the markings on the brick)
 @param [Boolean] accept_all If true, then `:all` will be allowed, otherwise it's an error.
 @return [UnsignedByte] The corresponding byte for the port.