code: func (g *Driver) PwmWrite(pin string, val byte) (err error) {
  	var (
  		grovePin, grovePort Grove
  	)
  	grovePin, grovePort, _, _, err = getGroveAddresses(pin)
  	if err != nil {
  		return err
  	}
  	err = g.SetGroveType(grovePort, CUSTOM)
  	if err != nil {
  		return err
  	}
  	time.Sleep(10 * time.Millisecond)
  	err = g.SetGroveMode(grovePin, GROVE_OUTPUT_PWM)
  	if err != nil {
  		return err
  	}
  	time.Sleep(10 * time.Millisecond)
  	err = g.SetPWMFreq(grovePin, 24000)
  	if err != nil {
  		return err
  	}
  	val64 := math.Float64frombits(uint64(val))
  	dutyCycle := uint16(math.Float64bits((100.0 / 255.0) * val64))
  	return g.SetPWMDuty(grovePin, dutyCycle)
  }
docs: // PwmWrite implents the pwm interface for the gopigo3.