public void DriveMotor(EnablePins pin, double dutyCyclePercentage) { var pwmPin = GetPin(pin); pwmPin.SetActiveDutyCyclePercentage(dutyCyclePercentage); if (!pwmPin.IsStarted) { pwmPin.Start(); } }
private PwmPin GetPin(EnablePins pin) { PwmPin pwmPin = null; if (pin == EnablePins.Enable12) pwmPin = this.Enable12Pin; else pwmPin = this.Enable34Pin; if (pwmPin == null) throw new Exception("Invalid Pin"); return pwmPin; }
private PwmPin GetPin(EnablePins pin) { PwmPin pwmPin = null; if (pin == EnablePins.Enable12) { pwmPin = this.Enable12Pin; } else { pwmPin = this.Enable34Pin; } if (pwmPin == null) { throw new Exception("Invalid Pin"); } return(pwmPin); }
public void DriveMotor(EnablePins pin, double dutyCyclePercentage) { var pwmPin = GetPin(pin); pwmPin.SetActiveDutyCyclePercentage(dutyCyclePercentage); if (!pwmPin.IsStarted) pwmPin.Start(); }