DigitalIn

object DigitalIn extends ProductReader[DigitalIn]
Companion
class
trait ProductReader[DigitalIn]
class Object
trait Matchable
class Any

Value members

Concrete methods

def apply(pin: Pin, pull: Ex[Option[Boolean]], init: Ex[Boolean], debounce: Ex[Int]): DigitalIn

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 to None.

override
def read(in: RefMapIn, key: String, arity: Int, adj: Int): DigitalIn
Definition Classes
ProductReader