public IContinuousRotationServo GetContinuousRotatioServo(byte portIndex, ServoConfig servoConfig) { if ((portIndex < 0) || (portIndex > portCount)) { throw new ArgumentException($"Continuous Rotatio Servo num must be between 1 and {portCount}", "num"); } var pwm = pca9685.CreatePwmPort(portIndex); var servo = new ContinuousRotationServo(pwm, servoConfig); return(servo); }
public IContinuousRotationServo GetContinuousRotatioServo(byte num, ServoConfig servoConfig) { if ((num < 0) || (num > _ports)) { throw new ArgumentException($"Continuous Rotatio Servo num must be between 1 and {_ports}", "num"); } IPwmPort pwm = _pca9685.CreatePwmPort(num); ContinuousRotationServo servo = new ContinuousRotationServo(pwm, servoConfig); return(servo); }