This method sets the direction of a GPIO.
The first input parameter GPIOnumber is a Python integer which is the number of the GPIO.
The second input parameter value is a Python integer which is the output value. It can be either 0 or 1. It is only used if the direction value is 1, it has no meaning if the direction value is 0.
The third input parameter direction is a Python integer which is the direction value. It can be either 0 for input or 1 for output. Other values are available for alternate functions. Refer to AT#GPIO command in product "AT Commands Reference Guide" for further notes (value is called mode).
The return value is a Python integer which is -1 if an error occurred otherwise is 1.
Example:
c = GPIO.setIOdir(4, 0, 0)
sets GPIO 4 to input with the value parameter having no meaning, and assigning the return value to c.
|
|
Note: When the direction value is not 1, although the parameter value has no meaning, it is necessary to assign it one of the two possible values: 0 or 1. |
|
|
Note: For version 18.11.004 the direction values for alternate functions are not supported. |