code: func (p *PWMPin) SetDutyCycle(duty uint32) (err error) {
  	if p.period == 0 {
  		return errors.New("Raspi PWM pin period not set")
  	}
  
  	if duty > p.period {
  		return errors.New("Duty cycle exceeds period.")
  	}
  	p.dc = duty
  
  	val := gobot.FromScale(float64(p.dc), 0, float64(p.period))
  
  	// never go below minimum allowed duty for pi blaster
  	if val < 0.05 {
  		val = 0.05
  	}
  	return p.piBlaster(fmt.Sprintf("%v=%v\n", p.pin, val))
  }
docs: // SetDutyCycle writes the duty cycle to the pin