Photocoupler
Python Library for Photocouplers.
Turta_Photocoupler library is responsible for reading input states from the photocoupler.
Add the following statement to the top of your Python code.
from turta_iothat3 import Turta_Photocoupler
Then, create an instance of the PhotocouplerInputs class.
photocoupler = Turta_Photocoupler.PhotocouplerInputs()
Now you're ready to access the library by calling its instance.
Reads the photocoupler input state.
read(ch)
Parameters
Byte ch: Photocoupler channel. (1 or 2.) Returns
Bool: Photocoupler input state. (True for high, False for low.)
When exiting from the program, the library releases the GPIO pins.
Last modified 3yr ago