Characteristic Locus
Inheritance System.Object > SoftPwmPort
Namespace Meadow.Foundation.Generators
Assembly Meadow.Foundation.dll

Syntax

public class SoftPwmPort : IPwmPort

Constructors

SoftPwmPort(IDigitalOutputPort, Single, Single)

Instantiate a SoftPwm object that can perform PWM using digital pins

Declaration
public SoftPwmPort(IDigitalOutputPort outputPort, float dutyCycle = 0F, float frequency = 100F)

Parameters

Type Name Description
IDigitalOutputPort outputPort
System.Single dutyCycle
System.Single frequency

Fields

_dutyCycle

Declaration
protected float _dutyCycle

Field Value

Type Description
System.Single

_frequency

Declaration
protected float _frequency

Field Value

Type Description
System.Single

_offTimeMilliseconds

Declaration
protected int _offTimeMilliseconds

Field Value

Type Description
System.Int32

_onTimeMilliseconds

Declaration
protected int _onTimeMilliseconds

Field Value

Type Description
System.Int32

_running

Declaration
protected bool _running

Field Value

Type Description
System.Boolean

_th

Declaration
protected Thread _th

Field Value

Type Description
System.Threading.Thread

Properties

Channel

Declaration
public IPwmChannelInfo Channel { get; protected set; }

Property Value

Type Description
IPwmChannelInfo

Duration

Declaration
public float Duration { get; set; }

Property Value

Type Description
System.Single

DutyCycle

Declaration
public float DutyCycle { get; set; }

Property Value

Type Description
System.Single

Frequency

Declaration
public float Frequency { get; set; }

Property Value

Type Description
System.Single

Inverted

Declaration
public bool Inverted { get; set; }

Property Value

Type Description
System.Boolean

Period

Declaration
public float Period { get; set; }

Property Value

Type Description
System.Single

Pin

Declaration
public IPin Pin { get; }

Property Value

Type Description
IPin

Port

Declaration
protected IDigitalOutputPort Port { get; set; }

Property Value

Type Description
IDigitalOutputPort

State

Declaration
public bool State { get; }

Property Value

Type Description
System.Boolean

TimeScale

Declaration
public TimeScale TimeScale { get; set; }

Property Value

Type Description
TimeScale

Methods

CalculateOffTimeMillis()

Declaration
protected int CalculateOffTimeMillis()

Returns

Type Description
System.Int32

CalculateOnTimeMillis()

Calculates the pulse on time in milliseconds

Declaration
protected int CalculateOnTimeMillis()

Returns

Type Description
System.Int32

Dispose()

Declaration
public void Dispose()

Dispose(Boolean)

Declaration
protected virtual void Dispose(bool disposing)

Parameters

Type Name Description
System.Boolean disposing

Start()

Start the pulse width modulation

Declaration
public void Start()

Stop()

Stop the pulse width modulation

Declaration
public void Stop()