Esempio n. 1
0
        /// <inheritdoc />
        public async Task ChangeDutyCyclePercentAsync(int percent)
        {
            var targetDutyCycle = Math.Min(100, Math.Max(0, percent));

            await _activePin.ChangeDutyCycleInStepsAsync(targetDutyCycle, _stepsPerChange, 80);

            DutyCyclePercent = percent;
        }
Esempio n. 2
0
 public static Task Stop(this IPwmPin pwmPin, int stepsPerChange = 3, int delayPerStepMs = 40)
 {
     return(pwmPin.ChangeDutyCycleInStepsAsync(0, stepsPerChange, delayPerStepMs));
 }