Table of Contents

Class GpioButton

Namespace
Iot.Device.Button
Assembly
Iot.Device.Button.dll

GPIO implementation of Button. Inherits from ButtonBase.

public class GpioButton : ButtonBase
Inheritance
GpioButton
Inherited Members

Constructors

GpioButton(int, GpioController, bool, PinMode, TimeSpan)

Initializes a new instance of the GpioButton class.

public GpioButton(int buttonPin, GpioController gpio = null, bool shouldDispose = true, PinMode pinMode = PinMode.InputPullUp, TimeSpan debounceTime = default)

Parameters

buttonPin int

GPIO pin of the button.

gpio GpioController

Gpio Controller.

shouldDispose bool

True to dispose the GpioController.

pinMode PinMode

Pin mode of the system.

debounceTime TimeSpan

The amount of time during which the transitions are ignored, or zero.

GpioButton(int, TimeSpan, TimeSpan, GpioController?, bool, PinMode, TimeSpan)

Initializes a new instance of the GpioButton class.

public GpioButton(int buttonPin, TimeSpan doublePress, TimeSpan holding, GpioController? gpio = null, bool shouldDispose = true, PinMode pinMode = PinMode.InputPullUp, TimeSpan debounceTime = default)

Parameters

buttonPin int

GPIO pin of the button.

doublePress TimeSpan

Max ticks between button presses to count as doublepress.

holding TimeSpan

Min ms a button is pressed to count as holding.

gpio GpioController

Gpio Controller.

shouldDispose bool

True to dispose the GpioController.

pinMode PinMode

Pin mode of the system.

debounceTime TimeSpan

The amount of time during which the transitions are ignored, or zero.

Methods

Dispose(bool)

Internal cleanup.

protected override void Dispose(bool disposing)

Parameters

disposing bool

Should dispose managed resources.