GHIElectronics.UAP.Shields.FEZHAT.SetPwmDutyCycle C# (CSharp) Method

SetPwmDutyCycle() public method

Sets the duty cycle of the given pwm pin.
public SetPwmDutyCycle ( PwmPin pin, double value ) : void
pin PwmPin The pin to set the duty cycle for.
value double The new duty cycle between 0 (off) and 1 (on).
return void
        public void SetPwmDutyCycle(PwmPin pin, double value) {
            if (value < 0.0 || value > 1.0) throw new ArgumentOutOfRangeException(nameof(value));
            if (!Enum.IsDefined(typeof(PwmPin), pin)) throw new ArgumentException(nameof(pin));

            this.pwm.SetDutyCycle((int)pin, value);
        }