Skip to main content

Interface IPwmOutputController

Contract for devices that expose IPwmPort(s).

Assembly: Meadow.Contracts.dll
View Source
public interface IPwmOutputController : IPinController

Fields

DefaultPwmFrequency

The default PWM frequency.

View Source
public const float DefaultPwmFrequency = 100

DefaultPwmDutyCycle

The default PWM duty cycle.

View Source
public const float DefaultPwmDutyCycle = 0.5

Methods

CreatePwmPort(IPin, Frequency, float, bool)

Creates an IPwmPort on the specified pin.

View Source
IPwmPort CreatePwmPort(IPin pin, Frequency frequency, float dutyCycle = 0.5, bool invert = false)
Returns

Meadow.Hardware.IPwmPort: The created PWM port.

Parameters
TypeNameDescription
Meadow.Hardware.IPinpinThe pin on which to create the PWM port.
Meadow.Units.FrequencyfrequencyThe desired frequency of the PWM signal.
System.SingledutyCycleThe desired duty cycle of the PWM signal. Defaults to Meadow.Hardware.IPwmOutputController.DefaultPwmDutyCycle.
System.BooleaninvertSpecifies whether the PWM signal should be inverted. Defaults to false.