GpioChangeCounter.Polarity Property

Definition

Gets or sets the polarity of transitions that will be counted. The polarity may only be changed when pin counting is not started.

public:
 property GpioChangePolarity Polarity { GpioChangePolarity get(); void set(GpioChangePolarity value); };
GpioChangePolarity Polarity();

void Polarity(GpioChangePolarity value);
public GpioChangePolarity Polarity { get; set; }
var gpioChangePolarity = gpioChangeCounter.polarity;
gpioChangeCounter.polarity = gpioChangePolarity;
Public Property Polarity As GpioChangePolarity

Property Value

Remarks

The default polarity value is Falling. See GpioChangePolarity for more information on polarity values. Counting a single edge can be considerably more efficient than counting both edges.

The following exceptions can be thrown when setting the polarity:

  • E_INVALIDARG - value is not a valid GpioChangePolarity value.
  • HRESULT_FROM_WIN32(ERROR_BAD_COMMAND) - change counting is currently active. Polarity can only be set before calling Start() or after calling Stop().

Applies to