Beispiel #1
0
        public void DriveMotor(EnablePins pin, double dutyCyclePercentage)
        {
            var pwmPin = GetPin(pin);

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