Digital
Python Library for Digital IO Ports.
Python Library
Turta_Digital library is responsible for setting and getting GPIO pin states of the digital ports.
Initialization
Add the following statement to the top of your Python code.
Then, create an instance of the DigitalPort class.
Now you're ready to access the library by calling its instance.
Initialization Parameters
DigitalPort
Initiates the GPIO pins.
Parameters
Bool d1In: Pin 1 direction. (True for input, False for output, True is default.)
Bool d2In: Pin 2 direction. (True for input, False for output, True is default)
Bool d3In: Pin 3 direction. (True for input, False for output, True is default)
Bool d4In: Pin 4 direction. (True for input, False for output, True is default)
Basic Members
Read Input Pin
Reads the digital input.
Parameters
Byte ch: IO Channel. (1 to 4.)
Returns
Bool: Pin input state. (True for high, False for low.)
Write Output Pin
Sets the digital output.
Parameters
Byte ch: IO Channel. (1 to 4.)
Bool st: Pin output state. (True for high, False for low.)
Returns
None
Toggle Output Pin
Inverts the digital output.
Parameters
Byte ch: IO Channel. (1 to 4.)
Returns
None
Finalizer
When exiting from the program, the library releases the GPIO pins.
Last updated