Skip to main content

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​
Declaration
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​
Declaration
protected IMeadowIOController IOController { get; set; }

PwmChannelInfo​

PWM Channel Info

View Source​
Declaration
protected IPwmChannelInfo PwmChannelInfo { get; set; }

Inverted​

When true Duty Cycle is "percentage of time spent low" rather than high.

View Source​
Declaration
public override bool Inverted { get; set; }

Frequency​

The frequency, in Hz (cycles per second) of the PWM square wave.

View Source​
Declaration
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​
Declaration
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​
Declaration
public override TimePeriod Duration { get; set; }

Period​

The reciprocal of the PWM frequency - in seconds.

View Source​
Declaration
public override TimePeriod Period { get; set; }

State​

Returns true if the PWM is currently running, otherwise false

View Source​
Declaration
public override bool State { get; }

Methods​

Start()​

Starts the PWM output

View Source​
Declaration
public override void Start()

Stop()​

Stops the PWM output

View Source​
Declaration
public override void Stop()

Dispose(bool)​

Releases the resources used by the port.

View Source​
Declaration
protected override void Dispose(bool disposing)
Parameters​
TypeNameDescription
System.BooleandisposingA boolean value indicating whether the port is being disposed.

Implements​