Ejemplo n.º 1
0
 private void SetLogLevel(IPwmDevice device)
 {
     var stubPwmDevice = device as PwmDeviceStub;
     if (stubPwmDevice != null)
     {
         // Remove sign of life which is too chatty
         stubPwmDevice.LogChannels.Remove(PwmChannel.C0);
     }
 }
Ejemplo n.º 2
0
        private void SetLogLevel(IPwmDevice device)
        {
            var stubPwmDevice = device as PwmDeviceStub;

            if (stubPwmDevice != null)
            {
                // Remove sign of life which is too chatty
                stubPwmDevice.LogChannels.Remove(PwmChannel.C0);
            }
        }
Ejemplo n.º 3
0
 private void RunRawPwm(IPwmDevice pwmDevice)
 {
     while (!Console.KeyAvailable)
     {
         var channel = PwmChannel.C0;
         var pwmOn   = 2000;
         var pwmOff  = 2000;
         Log.Info(m => m("Set channel={0} to {1}", channel, pwmOn));
         pwmDevice.SetPwm(channel, 0, pwmOn);
         Thread.Sleep(1000);
         Log.Info(m => m("Set channel={0} to {1}", channel, pwmOff));
         pwmDevice.SetPwm(PwmChannel.C0, 0, pwmOff);
         Thread.Sleep(1000);
     }
 }
Ejemplo n.º 4
0
        public StepperMotor(
            IPwmDevice controller
            , PwmChannel controlChannel0
            , PwmChannel controlChannel1
            , PwmChannel controlChannel2
            , PwmChannel controlChannel3)
            : base(controller)
        {
            _channels = new [] {controlChannel0, controlChannel1, controlChannel2, controlChannel3};
            _currentStep = 0;
            StepDelayMs = 100;

            Sequence = new[]
            {
                "1000",
                "1100",
                "0100",
                "0110",
                "0010",
                "0011",
                "0001",
                "1001"
            };
        }
Ejemplo n.º 5
0
        public StepperMotor(
            IPwmDevice controller
            , PwmChannel controlChannel0
            , PwmChannel controlChannel1
            , PwmChannel controlChannel2
            , PwmChannel controlChannel3)
            : base(controller)
        {
            _channels    = new [] { controlChannel0, controlChannel1, controlChannel2, controlChannel3 };
            _currentStep = 0;
            StepDelayMs  = 100;

            Sequence = new[]
            {
                "1000",
                "1100",
                "0100",
                "0110",
                "0010",
                "0011",
                "0001",
                "1001"
            };
        }
Ejemplo n.º 6
0
 public PwmController(IPwmDevice pwmDevice)
 {
     _pwmDevice = pwmDevice;
 }
Ejemplo n.º 7
0
 public PanTiltMechanism(IPwmDevice pwmDevice) : base(pwmDevice)
 {
     PanServo  = new ServoMotor(PwmDevice, PwmChannel.C1, 130, 670);
     TiltServo = new ServoMotor(PwmDevice, PwmChannel.C0, 130, 670);
 }
Ejemplo n.º 8
0
 protected PwmControlBase(IPwmDevice pwmDevice)
 {
     PwmDevice = pwmDevice;
 }
Ejemplo n.º 9
0
 public PwmController(IPwmDevice pwmDevice)
     : base(pwmDevice)
 {
 }
Ejemplo n.º 10
0
 protected PwmControlBase(IPwmDevice pwmDevice)
 {
     PwmDevice = pwmDevice;
     // _components = new Dictionary<PwmChannel, PwmComponentBase>();
 }
Ejemplo n.º 11
0
 protected PwmComponentBase(IPwmDevice controller)
 {
     Controller = controller;
 }
Ejemplo n.º 12
0
 public ServoMotor(IPwmDevice controller, PwmChannel channel, int mimimum, int maximum): base(controller)
 {
     Channel = channel;
     MaximumPosition = maximum;
     MinimumPosition = mimimum;
 }
Ejemplo n.º 13
0
 public Led(IPwmDevice controller, PwmChannel channel)
     : base(controller)
 {
     _channel = channel;
 }
Ejemplo n.º 14
0
 public ServoSortPwmControl(IPwmDevice pwmDevice) : base(pwmDevice)
 {
 }
Ejemplo n.º 15
0
 public ServoMotor(IPwmDevice controller, PwmChannel channel, int mimimum, int maximum) : base(controller)
 {
     Channel         = channel;
     MaximumPosition = maximum;
     MinimumPosition = mimimum;
 }
Ejemplo n.º 16
0
 public PanTiltMechanism(IPwmDevice pwmDevice) : base(pwmDevice)
 {
     PanServo = new ServoMotor(PwmDevice, PwmChannel.C1, 130, 670);
     TiltServo = new ServoMotor(PwmDevice, PwmChannel.C0, 130, 670);
 }
Ejemplo n.º 17
0
 public PwmController(IPwmDevice pwmDevice)
 {
     _pwmDevice = pwmDevice;
 }
Ejemplo n.º 18
0
 public PwmController(IPwmDevice pwmDevice)
     : base(pwmDevice)
 {
 }
Ejemplo n.º 19
0
 /// <summary>
 /// Assumes a SN754410 or equivalent wired to the PWM channels
 /// </summary>
 public DcMotor(IPwmDevice controller, PwmChannel controlChannel0, PwmChannel controlChannel1)
     : base(controller)
 {
     _controlChannel0 = controlChannel0;
     _controlChannel1 = controlChannel1;
 }
Ejemplo n.º 20
0
 public Led(IPwmDevice controller, PwmChannel channel)
     : base(controller)
 {
     _channel = channel;
 }
Ejemplo n.º 21
0
 private void RunRawPwm(IPwmDevice pwmDevice)
 {
     while (!Console.KeyAvailable)
     {
         var channel = PwmChannel.C0;
         var pwmOn = 2000;
         var pwmOff = 2000;
         Log.Info(m => m("Set channel={0} to {1}", channel, pwmOn));
         pwmDevice.SetPwm(channel, 0, pwmOn);
         Thread.Sleep(1000);
         Log.Info(m => m("Set channel={0} to {1}", channel, pwmOff));
         pwmDevice.SetPwm(PwmChannel.C0, 0, pwmOff);
         Thread.Sleep(1000);
     }
 }
Ejemplo n.º 22
0
 protected PwmControlBase(IPwmDevice pwmDevice)
 {
     PwmDevice = pwmDevice;
 }
Ejemplo n.º 23
0
 protected PwmControlBase(IPwmDevice pwmDevice)
 {
     PwmDevice = pwmDevice;
    // _components = new Dictionary<PwmChannel, PwmComponentBase>();
 }
Ejemplo n.º 24
0
 public ServoSortPwmControl(IPwmDevice pwmDevice) : base(pwmDevice)
 {
     
 }
Ejemplo n.º 25
0
 protected PwmComponentBase(IPwmDevice controller)
 {
     Controller = controller;
 }
Ejemplo n.º 26
0
 /// <summary>
 /// Assumes a SN754410 or equivalent wired to the PWM channels
 /// </summary>
 public DcMotor(IPwmDevice controller, PwmChannel controlChannel0, PwmChannel controlChannel1)
     : base(controller)
 {
     _controlChannel0 = controlChannel0;
     _controlChannel1 = controlChannel1;
 }