Ejemplo n.º 1
0
        public Servo(int pin, int possition = 0)
        {
            var defaultDuration = TimeSpan.FromMilliseconds(Helpers.Map(possition, 180f, 0f, DurationMax, DurationMin));

            this.pwmChannel = new SoftwarePwm(pin, TimeSpan.FromMilliseconds(Period), defaultDuration);
            this.pwmChannel.Start();
        }
Ejemplo n.º 2
0
        public Motor(int pinA, int pinB)
        {
            this.speed = 0;

            this.pwmChannelA = new SoftwarePwm(pinA, TimeSpan.FromMilliseconds(Period), 0);
            this.pwmChannelB = new SoftwarePwm(pinB, TimeSpan.FromMilliseconds(Period), 0);

            this.pwmChannelA.Start();
            this.pwmChannelB.Start();
        }
Ejemplo n.º 3
0
        public GpioRgbLed(int redPin, int greenPin, int bluePin)
        {
            this.redPwm = new SoftwarePwm(redPin, Period);
            this.greenPwm = new SoftwarePwm(greenPin, Period);
            this.bluePwm = new SoftwarePwm(bluePin, Period);

            this.redPwm.Start();
            this.greenPwm.Start();
            this.bluePwm.Start();
        }
 public SystemPinInterface(byte bcmIdentifier, IGpioController controller, IPwmChannel pwm)
 {
     _pin        = bcmIdentifier;
     _controller = controller;
     _pwm        = pwm;
 }