/// <inheritdoc /> public async Task ChangeDutyCyclePercentAsync(int percent) { var targetDutyCycle = Math.Min(100, Math.Max(0, percent)); await _activePin.ChangeDutyCycleInStepsAsync(targetDutyCycle, _stepsPerChange, 80); DutyCyclePercent = percent; }
public static Task Stop(this IPwmPin pwmPin, int stepsPerChange = 3, int delayPerStepMs = 40) { return(pwmPin.ChangeDutyCycleInStepsAsync(0, stepsPerChange, delayPerStepMs)); }