示例#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);
     }
 }
示例#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);
            }
        }
示例#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);
     }
 }
示例#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"
            };
        }
示例#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"
            };
        }
示例#6
0
 public PwmController(IPwmDevice pwmDevice)
 {
     _pwmDevice = pwmDevice;
 }
 public PanTiltMechanism(IPwmDevice pwmDevice) : base(pwmDevice)
 {
     PanServo  = new ServoMotor(PwmDevice, PwmChannel.C1, 130, 670);
     TiltServo = new ServoMotor(PwmDevice, PwmChannel.C0, 130, 670);
 }
示例#8
0
 protected PwmControlBase(IPwmDevice pwmDevice)
 {
     PwmDevice = pwmDevice;
 }
示例#9
0
 public PwmController(IPwmDevice pwmDevice)
     : base(pwmDevice)
 {
 }
示例#10
0
 protected PwmControlBase(IPwmDevice pwmDevice)
 {
     PwmDevice = pwmDevice;
     // _components = new Dictionary<PwmChannel, PwmComponentBase>();
 }
示例#11
0
 protected PwmComponentBase(IPwmDevice controller)
 {
     Controller = controller;
 }
示例#12
0
 public ServoMotor(IPwmDevice controller, PwmChannel channel, int mimimum, int maximum): base(controller)
 {
     Channel = channel;
     MaximumPosition = maximum;
     MinimumPosition = mimimum;
 }
示例#13
0
文件: Led.cs 项目: hguomin/RPi.Demo
 public Led(IPwmDevice controller, PwmChannel channel)
     : base(controller)
 {
     _channel = channel;
 }
 public ServoSortPwmControl(IPwmDevice pwmDevice) : base(pwmDevice)
 {
 }
示例#15
0
 public ServoMotor(IPwmDevice controller, PwmChannel channel, int mimimum, int maximum) : base(controller)
 {
     Channel         = channel;
     MaximumPosition = maximum;
     MinimumPosition = mimimum;
 }
示例#16
0
 public PanTiltMechanism(IPwmDevice pwmDevice) : base(pwmDevice)
 {
     PanServo = new ServoMotor(PwmDevice, PwmChannel.C1, 130, 670);
     TiltServo = new ServoMotor(PwmDevice, PwmChannel.C0, 130, 670);
 }
示例#17
0
 public PwmController(IPwmDevice pwmDevice)
 {
     _pwmDevice = pwmDevice;
 }
示例#18
0
 public PwmController(IPwmDevice pwmDevice)
     : base(pwmDevice)
 {
 }
示例#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;
 }
示例#20
0
文件: Led.cs 项目: llenroc/RPi.Demo
 public Led(IPwmDevice controller, PwmChannel channel)
     : base(controller)
 {
     _channel = channel;
 }
示例#21
0
文件: Program.cs 项目: Revex/RPi.Demo
 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);
     }
 }
示例#22
0
 protected PwmControlBase(IPwmDevice pwmDevice)
 {
     PwmDevice = pwmDevice;
 }
示例#23
0
 protected PwmControlBase(IPwmDevice pwmDevice)
 {
     PwmDevice = pwmDevice;
    // _components = new Dictionary<PwmChannel, PwmComponentBase>();
 }
示例#24
0
 public ServoSortPwmControl(IPwmDevice pwmDevice) : base(pwmDevice)
 {
     
 }
示例#25
0
 protected PwmComponentBase(IPwmDevice controller)
 {
     Controller = controller;
 }
示例#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;
 }