/// <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) { this.pwmController = pwmController; in1 = new PwmBoolean(pwmController.GetPwmChannel(in1PwmChannelNumber)); in2 = new PwmBoolean(pwmController.GetPwmChannel(in2PwmChannelNumber)); powerControl = pwmController.GetPwmChannel(pwmPowerControlChannelNumber); }
/// <summary> /// Initializes a new instance of the <see cref="AdafruitV2MotorShield" /> class at the specified /// I2C address. /// </summary> /// <param name="address"> /// The I2C base address of the shield (optional; defaults to 0x60). /// </param> public AdafruitV2MotorShield(ushort address = 0x60) { pwmController = new Pca9685PwmController(address); }