Photocoupler

Python Library for Photocouplers.

Python Library

Turta_Photocoupler library is responsible for reading input states from the photocoupler.

Initialization

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.

Basic Members

Read

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.)

Finalizer

When exiting from the program, the library releases the GPIO pins.

Last updated