code: func (d *GrovePiDriver) PinMode(pin byte, mode string) error {
  	var b []byte
  	if mode == "output" {
  		b = []byte{CommandPinMode, pin, 1, 0}
  	} else {
  		b = []byte{CommandPinMode, pin, 0, 0}
  	}
  	_, err := d.connection.Write(b)
  
  	time.Sleep(2 * time.Millisecond)
  
  	_, err = d.connection.ReadByte()
  
  	return err
  }
docs: // PinMode sets the pin mode to input or output.