![Telit Wireless Solutions EZ10 Series Скачать руководство пользователя страница 50](http://html1.mh-extra.com/html/telit-wireless-solutions/ez10-series/ez10-series_product-description_1083786050.webp)
Telit EZ10-GPRS/-PCS
Product Description
80269ST10014a, Rev. 3 – 26/09/05
Reproduction forbidden without written authorization by Telit Communications S.p.A.
Page 50 of 74
All Rights reserved – Right of modification reserved
Return value is a Python integer which is -1 if an error occurred otherwise is input or output value.
It is 0 or 1.
Example:
a = GPIO.getIOvalue(5)
gets GPIO 5 input or output value, assigning return value to b.
3.3.5.3.3 GPIO.setIOdir(GPIOnumber, value, direction)
Sets direction of a GPIO.
First input parameter GPIOnumber is a Python integer which is the number of the GPIO.
Second input parameter value is a Python integer which is the ouput value. It can be 0 or 1. It is
only used if direction value is 1.
Third input parameter value is a Python integer which is the direction value. It can be 0 for input or
1 for output.
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 value having no meaning, assigning return value to c.
3.3.5.3.4 GPIO.getIOdir(GPIOnumber)
Gets direction of a GPIO.
Input parameter GPIOnumber is a Python integer which is the number of the GPIO.
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.
Example:
d = GPIO.getIOdir(7)
gets GPIO 7 direction, assigning return value to d.
3.3.5.4 MOD built-in module
MOD built-in module is the interface between Python and module miscellaneous functions.
You need to use MOD built-in module if you want to generate timers in Python script, to reactivate
Python from Python script, etc.
If you want to use MOD built-in module you need to import it first:
import MOD
then you can use MOD built-in module methods like in the following example:
MOD.reactivatePython()
which reactivates Python after next exiting from Python script.
More details about MOD built-in module methods are in the following paragraphs.
3.3.5.4.1 MOD.secCounter()
Returns seconds elapsed since 1 January 1970.
This method is useful for timers generation in Python script.
No input parameter.
Return value is a Python integer which is the value of seconds elapsed since 1 January 1970.