Skip to main content

Class SoftPwmPort

A Pulse Width Modulation Generator that can generates waveforms in software. The maximum Frequency is about 100 Hz.

Note: This class is not yet implemented.

Assembly: Meadow.dll
View Source
public class SoftPwmPort : IPwmPort, IDigitalPort, IPort<IDigitalChannelInfo>, IDisposable

Implements:
Meadow.Hardware.IPwmPort, Meadow.Hardware.IDigitalPort, Meadow.Hardware.IPort<C>, System.IDisposable

Properties

Port

Digital output port used for PWM

View Source
protected IDigitalOutputPort Port { get; set; }

Duration

PWM duration in ms

View Source
public float Duration { get; set; }

Period

Period of PWM

View Source
public float Period { get; set; }

Inverted

Is the PWM signal inverted

View Source
public bool Inverted { get; set; }

DutyCycle

Duty cycle of PWM

View Source
public float DutyCycle { get; set; }

Frequency

Frequency of soft PWM

View Source
public Frequency Frequency { get; set; }

Channel

Channel info for PWM port

View Source
public IPwmChannelInfo Channel { get; protected set; }

State

State of PWM port (running / not running)

View Source
public bool State { get; }

Pin

Pin used for soft PWM

View Source
public IPin Pin { get; }

TimeScale

Timescale

View Source
public TimeScale TimeScale { get; set; }

Methods

Start()

Start the pulse width modulation

View Source
public void Start()

Stop()

Stop the pulse width modulation

View Source
public void Stop()

CalculateOnTimeMillis()

Calculates the pulse on time in milliseconds

View Source
protected int CalculateOnTimeMillis()
Returns

System.Int32

CalculateOffTimeMillis()

Calculates the off time of pulse in milliseconds

View Source
protected int CalculateOffTimeMillis()
Returns

System.Int32

Dispose(bool)

Dispose of the object

View Source
protected virtual void Dispose(bool disposing)
Parameters
TypeNameDescription
System.BooleandisposingIs disposing

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

View Source
public void Dispose()

Implements