This module depends on the event_loop
module, so it must only be imported after event_loop
is imported.
get
Gets a Pin
object that can be used to manage a pin.
pin
: pin identifier (examples: "pc3"
, 7
, "pa6"
, 3
)A Pin
object
Pin
objectPin.init()
Configures a pin
mode
: Mode
object:direction
(required): either "in"
or "out"
outMode
(required for direction: "out"
): either "open_drain"
or "push_pull"
inMode
(required for direction: "in"
): either "analog"
, "plain_digital"
, "interrupt"
or "event"
edge
(required for inMode: "interrupt"
or "event"
): either "rising"
, "falling"
or "both"
pull
(optional): either "up"
, "down"
or unsetPin.write()
Writes a digital value to a pin configured with direction: "out"
value
: boolean logic level to writePin.read()
Reads a digital value from a pin configured with direction: "in"
and any inMode
except "analog"
Boolean logic level
Pin.readAnalog()
Reads an analog voltage level in millivolts from a pin configured with direction: "in"
and inMode: "analog"
Voltage on pin in millivolts
Pin.interrupt()
Attaches an interrupt to a pin configured with direction: "in"
and inMode: "interrupt"
or "event"
An event loop Contract
object that identifies the interrupt event source. The event does not produce any extra data.