public StepperMotorHelper(TreatmentListItemModel treatment)
 {
     _uln2003Driver  = new Uln2003Driver(26, 13, 6, 5);
     _infusionSpeed  = treatment.InfusionSpeed;
     _dosage         = treatment.Dosage;
     _solutionVolume = treatment.SolutionVolume;
     _patientWeight  = treatment.PatientWeight;
 }
Пример #2
0
        private async Task TurnMotor(int degree, TurnDirection direction, bool isStop = false)
        {
            foreach (var pin in GpioPins)
            {
                pin.Key.Dispose();
            }

            using (var uln2003Driver = new Uln2003Driver(controller, 26, 13, 6, 5))
            {
                // bug
                if (isStop)
                {
                    uln2003Driver.Stop();
                }
                else
                {
                    await uln2003Driver.TurnAsync(degree, direction, CancellationToken.None);
                }
            }

            InitAllGPIOPin();
        }
 public StepperMotorHelper()
 {
     _uln2003Driver = new Uln2003Driver(26, 13, 6, 5);
 }