- Companion
- class
Value members
Concrete methods
Creates a digital input on the given pin. It can be used to attach and listen to buttons on the GPIO, for example.
Creates a digital input on the given pin. It can be used to attach and listen to buttons on the GPIO, for example.
''Note:'' Because initialization takes place outside a transaction, the value of the pin
is initially unknown and thus can be given as init
. When initialized, this pin is actually polled,
potentially triggering actions in the user code.
- Value Params
- debounce
if zero or positive, specifies a debounce option in milliseconds. Debouncing is used when due to noise or imprecision multiple button clicks are detected when they should be treated as one. Defaults to
-1
.- init
the assumed initial state (defaults to
false
)- pin
the pin to poll
- pull
if defined, sets a pull-up (
true
) or pull-down (false
) resistor. Defaults toNone
.