Relay
Python Library for Solid State Relays.
Turta_Relay library is responsible for controlling solid state relays.
Add the following statement to the top of your Python code.
from turta_iothat3 import Turta_Relay
Then, create an instance of the RelayController class.
relay = Turta_Relay.RelayController()
Now you're ready to access the library by calling its instance.
Controls the relay.
write(ch, st)
Parameters
Byte ch: Relay channel. (1 or 2.) Bool st: Relay state. (True or False.) Returns
None
Inverts the relay's state.
toggle(ch)
Parameters
Byte ch: Relay channel. (1 or 2.) Returns
None
Reads the relay state.
read(ch)
Parameters
Byte ch: Relay channel. (1 or 2.) Returns
Bool: Relay state. (True or False.)
When exiting from the program, the library turns off the relays and then releases the GPIO pins.
Last modified 3yr ago