Exemple #1
0
        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;
        }
Exemple #2
0
 public void DriveMotor(EnablePins pin, double dutyCyclePercentage)
 {
     var pwmPin = GetPin(pin);
     pwmPin.SetActiveDutyCyclePercentage(dutyCyclePercentage);
     if (!pwmPin.IsStarted)
         pwmPin.Start();
 }