/// <summary> /// Instantiates a new Servo on the specified PWM Pin with the specified config. /// </summary> /// <param name="pwm"></param> /// <param name="config"></param> public ServoBase(IPwmPort pwm, ServoConfig config) { _config = config; _pwm = pwm; _pwm.Frequency = config.Frequency; _pwm.DutyCycle = 0; _pwm.Start(); }
/// <summary> /// Instantiates a new continuous rotation servo on the specified pin, with the specified configuration. /// </summary> /// <param name="pin"></param> /// <param name="config"></param> public ContinuousRotationServoBase(IPwmPort pwm, ServoConfig config) { _config = config; // OLD //_pwm = new PWM(pin, config.Frequency, 0, false); // NEW _pwm = pwm; _pwm.Frequency = (config.Frequency); _pwm.DutyCycle = (0); }
/// <summary> /// Instantiates a new Servo on the specified PWM Pin with the specified config. /// </summary> /// <param name="pwm"></param> /// <param name="config"></param> public ServoBase(IPwmPort pwm, ServoConfig config) { _config = config; // OLD //_pwm = new PWM(pin, config.Frequency, 0, false); // NEW _pwm = pwm; _pwm.Frequency = config.Frequency; _pwm.DutyCycle = 0; }
public Servo(IPwmPort pwm, ServoConfig config) : base(pwm, config) { }
/// <summary> /// Instantiates a new continuous rotation servo on the specified pin, with the specified configuration. /// </summary> /// <param name="pin"></param> /// <param name="config"></param> public ContinuousRotationServo(IPwmPort pwm, ServoConfig config) : base(pwm, config) { }
public Servo(IIODevice device, IPin pwm, ServoConfig config) : this(device.CreatePwmPort(pwm), config) { }