A two-state input over any line, with its polarity said once: a button, a float
switch, a reed switch, a limit switch. Contact.isAsserted answers whether it
is closed, pressed, or tripped, whatever level that takes on the wire.
Example
constfloat = Contact.activeLow(newPinScript([PinLevel.Low])) float.isAsserted() // true: a switch to ground reads low when closed
A two-state input over any line, with its polarity said once: a button, a float switch, a reed switch, a limit switch. Contact.isAsserted answers whether it is closed, pressed, or tripped, whatever level that takes on the wire.
Example