Skip to main content

Module switch

Module switch 

Source
Expand description

The parts that are one line: a switch driven, and a contact read, through a pin.

A relay, a solenoid valve, a pump through a transistor, an indicator lamp: each is an output line that is either asserted or not, and whether “asserted” is the high or the low level depends on the board. A button, a float switch, a reed contact, a motion detector: each is an input line read the same way. Switch and Contact carry the Polarity so a caller says on and off and never inverts by hand, and they implement the core [Actuator] and [Sensor] traits so a valve takes a profile’s bool and a float switch feeds a rule directly.

Structs§

Contact
An on/off part on an input line: a button, a float switch, a motion detector.
Switch
An on/off part on an output line: a relay, a valve, a lamp.