/// <summary>
        /// Construct a dual half bridge with PWM speed control
        /// </summary>
        /// <param name="A">The "A" channel half-bridge input</param>
        /// <param name="B">The "B" channel half-bridge input</param>
        /// <param name="Enable">The PWM input used to control the output enable</param>
        public DualHalfBridge(DigitalOutPin A, DigitalOutPin B, Pwm Enable)
        {
            Enable.Enabled = true;
            Enable.DutyCycle = 0;
            Enable.Enabled = true;
            A.MakeDigitalPushPullOut();
            B.MakeDigitalPushPullOut();

            enablePwm = Enable;
            this.A = A;
            this.B = B;

        }
Ejemplo n.º 2
0
 internal Pin2(TreehopperBoard device)
     : base(device, 2)
 {
     ioName =  "RC5";
     Pwm = new Pwm(this);
 }
Ejemplo n.º 3
0
 internal Pin5(TreehopperBoard device)
     : base(device, 5)
 {
     ioName =  "RC6";
     AnalogIn = new AnalogIn(this);
     Pwm = new Pwm(this);
 }
Ejemplo n.º 4
0
 public LedStrip()
 {
     //TODO: later we store this value and read the stored value for preset
     value = 0.8;
     pwm = new Pwm();
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Starts PWM hardware pulses.
 /// Frequencies above 30MHz are unlikely to work.
 /// </summary>
 /// <param name="frequency">The frequency. 0 (off) or 1-125000000 (125M).</param>
 /// <param name="dutyCycle">0 (off) to 1000000 (1M)(fully on).</param>
 public void Start(int frequency, int dutyCycle)
 {
     BoardException.ValidateResult(
         Pwm.GpioHardwarePwm(Pin.PinGpio, Convert.ToUInt32(frequency), Convert.ToUInt32(dutyCycle)));
 }
Ejemplo n.º 6
0
 public Lamp()
 {
     pwm = new Pwm();
 }
Ejemplo n.º 7
0
 internal PwmChannel(Pwm pwm, int channel, uint gpio)
 {
     this.pwm = pwm;
     this.channel = channel;
     this.gpio = gpio;
 }