GPIO.getIOdir(GPIOnumber)

This method gets the direction of a GPIO.

The input parameter GPIOnumber is a Python integer which is the number of the GPIO.

The return value is a Python integer which is -1 if an error occurred otherwise is direction value. It is 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.

 

Example:

 

d = GPIO.getIOdir(7)

 

gets GPIO 7 direction, assigning the return value to d.

Note: For version 18.11.004 the return values for alternate functions are not supported.