Class PwmPort
Represents a port that is capable of generating a Pulse-Width-Modulation signal - which approximates an analog output via digital pulses.
Assembly: Meadow.F7.dll
View Source
public class PwmPort : PwmPortBase, IPwmPort, IDigitalPort, IPort<IDigitalChannelInfo>, IDisposable
Inheritance: System.Object -> Meadow.Hardware.PortBase<C> -> Meadow.Hardware.DigitalPortBase -> Meadow.Hardware.PwmPortBase
Implements:
Meadow.Hardware.IPwmPort, Meadow.Hardware.IDigitalPort, Meadow.Hardware.IPort<C>, System.IDisposable
Properties
IOController
The IO controller
View Source
protected IMeadowIOController IOController { get; set; }
PwmChannelInfo
PWM Channel Info
View Source
protected IPwmChannelInfo PwmChannelInfo { get; set; }
Inverted
When true Duty Cycle is "percentage of time spent low" rather than high.
View Source
public override bool Inverted { get; set; }
Frequency
The frequency, in Hz (cycles per second) of the PWM square wave.
View Source
public override Frequency Frequency { get; set; }
DutyCycle
The percentage of time the PWM pulse is high (in the range of 0.0 to 1.0)
View Source
public override double DutyCycle { get; set; }
Duration
The amount of time, in seconds, that the a PWM pulse is high. This will always be less than or equal to the Period
View Source
public override TimePeriod Duration { get; set; }
Period
The reciprocal of the PWM frequency - in seconds.
View Source
public override TimePeriod Period { get; set; }
State
Returns true if the PWM is currently running, otherwise false
View Source
public override bool State { get; }
Methods
Start()
Starts the PWM output
View Source
public override void Start()
Stop()
Stops the PWM output
View Source
public override void Stop()
Dispose(bool)
Releases the resources used by the port.
View Source
protected override void Dispose(bool disposing)
Parameters
| Type | Name | Description |
|---|---|---|
System.Boolean | disposing | A boolean value indicating whether the port is being disposed. |