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
Declaration
public class SoftPwmPort : IPwmPort, IDigitalPort, IPort<IDigitalChannelInfo>, IDisposable
Implements:
Meadow.Hardware.IPwmPort, System.IDisposable
Properties
Port
Digital output port used for PWM
View Source
Declaration
protected IDigitalOutputPort Port { get; set; }
Duration
PWM duration in ms
View Source
Declaration
public float Duration { get; set; }
Period
Period of PWM
View Source
Declaration
public float Period { get; set; }
Inverted
Is the PWM signal inverted
View Source
Declaration
public bool Inverted { get; set; }
DutyCycle
Duty cycle of PWM
View Source
Declaration
public float DutyCycle { get; set; }
Frequency
Frequency of soft PWM
View Source
Declaration
public Frequency Frequency { get; set; }
Channel
Channel info for PWM port
View Source
Declaration
public IPwmChannelInfo Channel { get; protected set; }
State
State of PWM port (running / not running)
View Source
Declaration
public bool State { get; }
Pin
Pin used for soft PWM
View Source
Declaration
public IPin Pin { get; }
TimeScale
Timescale
View Source
Declaration
public TimeScale TimeScale { get; set; }
Methods
Start()
Start the pulse width modulation
View Source
Declaration
public void Start()
Stop()
Stop the pulse width modulation
View Source
Declaration
public void Stop()
CalculateOnTimeMillis()
Calculates the pulse on time in milliseconds
View Source
Declaration
protected int CalculateOnTimeMillis()
Returns
System.Int32
CalculateOffTimeMillis()
Calculates the off time of pulse in milliseconds
View Source
Declaration
protected int CalculateOffTimeMillis()
Returns
System.Int32
Dispose(bool)
Dispose of the object
View Source
Declaration
protected virtual void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | disposing | Is disposing |
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
View Source
Declaration
public void Dispose()