public ServoMotor(IPwmController pwmController, byte id) { this.pwmController = pwmController; this.id = id; Console.WriteLine($"Min: {servoMin}"); Console.WriteLine($"Max: {servoMax}"); }
internal PwmChannel(IPwmController controller, uint channel, uint period, uint duration) { _channel = channel; _period = period; _duration = duration; _controller = controller; Commit(); }
internal PwmChannel(IPwmController controller, uint channel, float dutyCycle) { if (dutyCycle < 0.0 || dutyCycle > 1.0) { throw new ArgumentOutOfRangeException("dutyCycle", "must be a fraction of unity"); } _channel = channel; _controller = controller; _dutyCycle = dutyCycle; Commit(); }
internal PwmChannel(IPwmController controller, uint channel, uint period, uint duration, ScaleFactor scale) { this.channel = channel; this.period = period; this.duration = duration; this.scale = scale; this.controller = controller; try { AllocateChannel(channel); Init(); Commit(); } catch { Dispose(false); } }
private async Task FadeInFadeOutAsync(IPwmController controller, GpioEnum gpio) { var led = new DimmableLed(controller, gpio, 10); while (true) { for (int i = 10; i <= 90; i += 4) { led.Dim(i, this); await Task.Delay(10); } for (int i = 90; i >= 10; i -= 4) { led.Dim(i, this); await Task.Delay(50); } } }
internal PwmChannel(IPwmController controller, uint channel, double dutyCycle) { if (dutyCycle < 0.0 || dutyCycle > 1.0) { throw new ArgumentOutOfRangeException("dutyCycle", "must be a fraction of unity"); } this.channel = channel; this.controller = controller; this.dutyCycle = dutyCycle; try { Init(); Commit(); } catch { Dispose(false); } }
public DimmableLed(IPwmController controller, GpioEnum gpio, int initialValue) { Pin = controller.OpenPin(gpio); Pin.Start(); Dim(initialValue, this); }
public SpeedController(IPwmController pwm) { _pwm = pwm; }
public GateController(ISelector selector, IPwmController pwmController, IGateStates gateStates) { _selector = selector; _pwmController = pwmController; _gateStates = gateStates; }