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
buttonPinintGPIO pin of the button.
gpioGpioControllerGpio Controller.
shouldDisposeboolTrue to dispose the GpioController.
pinModePinModePin mode of the system.
debounceTimeTimeSpanThe 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
buttonPinintGPIO pin of the button.
doublePressTimeSpanMax ticks between button presses to count as doublepress.
holdingTimeSpanMin ms a button is pressed to count as holding.
gpioGpioControllerGpio Controller.
shouldDisposeboolTrue to dispose the GpioController.
pinModePinModePin mode of the system.
debounceTimeTimeSpanThe amount of time during which the transitions are ignored, or zero.
Methods
Dispose(bool)
Internal cleanup.
protected override void Dispose(bool disposing)
Parameters
disposingboolShould dispose managed resources.