Class GpioButton
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
intGPIO pin of the button.
gpio
GpioControllerGpio Controller.
shouldDispose
boolTrue to dispose the GpioController.
pinMode
PinModePin mode of the system.
debounceTime
TimeSpanThe 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
intGPIO pin of the button.
doublePress
TimeSpanMax ticks between button presses to count as doublepress.
holding
TimeSpanMin ms a button is pressed to count as holding.
gpio
GpioControllerGpio Controller.
shouldDispose
boolTrue to dispose the GpioController.
pinMode
PinModePin mode of the system.
debounceTime
TimeSpanThe amount of time during which the transitions are ignored, or zero.
Methods
Dispose(bool)
Internal cleanup.
protected override void Dispose(bool disposing)
Parameters
disposing
boolShould dispose managed resources.