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

Syntax

public class SoftPwmPort : IPwmPort

Constructors

View Source

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

View Source

_dutyCycle

Declaration
protected float _dutyCycle

Field Value

Type Description
System.Single
View Source

_frequency

Declaration
protected float _frequency

Field Value

Type Description
System.Single
View Source

_offTimeMilliseconds

Declaration
protected int _offTimeMilliseconds

Field Value

Type Description
System.Int32
View Source

_onTimeMilliseconds

Declaration
protected int _onTimeMilliseconds

Field Value

Type Description
System.Int32
View Source

_running

Declaration
protected bool _running

Field Value

Type Description
System.Boolean
View Source

_th

Declaration
protected Thread _th

Field Value

Type Description
System.Threading.Thread

Properties

View Source

Channel

Declaration
public IPwmChannelInfo Channel { get; protected set; }

Property Value

Type Description
IPwmChannelInfo
View Source

Duration

Declaration
public float Duration { get; set; }

Property Value

Type Description
System.Single
View Source

DutyCycle

Declaration
public float DutyCycle { get; set; }

Property Value

Type Description
System.Single
View Source

Frequency

Declaration
public float Frequency { get; set; }

Property Value

Type Description
System.Single
View Source

Inverted

Declaration
public bool Inverted { get; set; }

Property Value

Type Description
System.Boolean
View Source

Period

Declaration
public float Period { get; set; }

Property Value

Type Description
System.Single
View Source

Pin

Declaration
public IPin Pin { get; }

Property Value

Type Description
IPin
View Source

Port

Declaration
protected IDigitalOutputPort Port { get; set; }

Property Value

Type Description
IDigitalOutputPort
View Source

Scale

Declaration
public TimeScaleFactor Scale { get; set; }

Property Value

Type Description
TimeScaleFactor

Methods

View Source

CalculateOffTimeMillis()

Declaration
protected int CalculateOffTimeMillis()

Returns

Type Description
System.Int32
View Source

CalculateOnTimeMillis()

Calculates the pulse on time in milliseconds

Declaration
protected int CalculateOnTimeMillis()

Returns

Type Description
System.Int32
View Source

Dispose()

Declaration
public void Dispose()
View Source

Dispose(Boolean)

Declaration
protected virtual void Dispose(bool disposing)

Parameters

Type Name Description
System.Boolean disposing
View Source

Start()

Start the pulse width modulation

Declaration
public void Start()
View Source

Stop()

Stop the pulse width modulation

Declaration
public void Stop()