/// <summary> /// Construct a hobby servo motor /// </summary> /// <param name="pwm">The PWM module to use</param> /// <param name="minPulseWidth">The minimum pulse width, in microseconds, corresponding to 0-degree angle</param> /// <param name="maxPulseWidth">The maximum pulse width, in microseconds, corresponding to 180-degree angle</param> public HobbyServo(Pwm pwm, double minPulseWidth = 500, double maxPulseWidth = 2500) { this.Pwm = pwm; pwm.Enabled = true; MinPulseWidth = minPulseWidth; MaxPulseWidth = maxPulseWidth; Angle = 90; }
/// <summary> /// Construct an STP16CPC26 attached to the output of another shift register /// </summary> /// <param name="upstreamDevice">The upstream device this shift register is attached to</param> /// <param name="OutputEnablePin">The PWM pin to use, if any, to control the display brightness</param> public Stp16cpc26(ChainableShiftRegisterOutput upstreamDevice, Pwm OutputEnablePin) : base(upstreamDevice, 2) { this.oePwm = OutputEnablePin; Start(); }
/// <summary> /// Construct an STP16CPC26 attached directly to a board SPI module /// </summary> /// <param name="SpiModule">The board's SPI module</param> /// <param name="LatchPin">The pin to use for latches</param> /// <param name="OutputEnablePin">The PWM pin to use, allowing controllable global brightness.</param> public Stp16cpc26(Spi SpiModule, Pin LatchPin, Pwm OutputEnablePin) : base(SpiModule, LatchPin, 2) { this.oePwm = OutputEnablePin; Start(); }