Exemplo n.º 1
0
 /// <summary>
 ///   Initializes a new instance of the <see cref="PwmControlledHBridge" /> class.
 /// </summary>
 /// <param name="pwmController">The 16-channel PWM controller instance that controls this motor phase.</param>
 /// <param name="in1PwmChannelNumber">The PWM channel number that provides the IN1 input for this winding.</param>
 /// <param name="in2PwmChannelNumber">The PWM channel number that provides the IN2 input for this winding.</param>
 /// <param name="pwmPowerControlChannelNumber">The PWM source.</param>
 public PwmControlledHBridge(
     Pca9685PwmController pwmController,
     ushort in1PwmChannelNumber,
     ushort in2PwmChannelNumber,
     ushort pwmPowerControlChannelNumber)
 {
     _pwmController = pwmController;
     _in1           = new PwmBoolean(pwmController.GetPwmChannel(in1PwmChannelNumber));
     _in2           = new PwmBoolean(pwmController.GetPwmChannel(in2PwmChannelNumber));
     _powerControl  = pwmController.GetPwmChannel(pwmPowerControlChannelNumber);
 }
Exemplo n.º 2
0
 /// <summary>
 ///   Initializes a new instance of the <see cref="AdafruitMotorShieldV2" /> class at the specified
 ///   I2C address.
 /// </summary>
 /// <param name="address">
 ///   The I2C base address of the shield (optional; defaults to 0x60).
 /// </param>
 public AdafruitMotorShieldV2(ushort address = 0x60)
 {
     pwmController = new Pca9685PwmController(address);
 }