Class GpioPinPwmService
Provides hardware-based PWM services on the pin.
Inherited Members
Namespace: Unosquare.PiGpio.ManagedModel
Syntax
public sealed class GpioPinPwmService : GpioPinServiceBase
Properties
Channel
Gets the PWM channel, 0 or 1. A negative number mans there is no associated PWM channel.
Declaration
public int Channel { get; }
Property Value
| Type | Description |
|---|---|
| Int32 |
Frequency
Gets the frequency.
Declaration
public int Frequency { get; }
Property Value
| Type | Description |
|---|---|
| Int32 |
Range
Gets the range of the duty cycle.
Declaration
public int Range { get; }
Property Value
| Type | Description |
|---|---|
| Int32 |
Methods
ResolveAvailable()
Resolves the availability of this service for the associated pin.
Declaration
protected override bool ResolveAvailable()
Returns
| Type | Description |
|---|---|
| Boolean | True when the service is deemed as available. |
Overrides
Start(Int32, Int32)
Starts PWM hardware pulses. Frequencies above 30MHz are unlikely to work.
Declaration
public void Start(int frequency, int dutyCycle)
Parameters
| Type | Name | Description |
|---|---|---|
| Int32 | frequency | The frequency. 0 (off) or 1-125000000 (125M). |
| Int32 | dutyCycle | 0 (off) to 1000000 (1M)(fully on). |
Stop()
Stops PWM hardware pulses.
Declaration
public void Stop()