PCFPin¶
-
class
pcf8574pin.
PCFPin
(pcf, pin)¶ Class to mimic machine.Pin or machine.Signal classes + more
This class aims to add compatibility for PCF8574 class with other classes which use Pin class like the asynchronous switch class “aswitch”.
Parameters: - pcf – PCF8574 device
- pin – pin to monitor
-
input
()¶ Set the pin as input
-
inverted
()¶ Set the pin as inverted
-
mode
(value=None, invert=False)¶ Get or set the pin mode (input or output)
Parameters: - value (str, optional) – “IN” or “OUT”
- invert (bool, optional) – True inverted pin, False non inverted pin. Default to False.
Returns: 1 for input, 0 for output
Return type: int
-
noninverted
()¶ Set the pin as non inverted
-
off
()¶ Desactivate the pin
-
on
()¶ Activate the pin
-
output
()¶ Set the pin as output
-
toggle
()¶ Toggle the pin in output mode
-
value
(value=None)¶ Get or set the value of the pin
If an argument argument is supplied, the pin is set to the value
Parameters: value (bool, optional) Returns: logical value of the pin Return type: int