Data Sheet

!
3. Basic AT Commands
3.2.20. AT+SYSGPIOWRITE—Configures the Output Level of a GPIO
3.2.21. AT+SYSGPIOREAD—Reads the GPIO Input Level
Example
AT+SYSIOSETCFG=12,3,1󰐇󰐇//Set󰐇GPIO12󰐇to󰐇work󰐇as󰐇a󰐇GPIO
AT+SYSGPIODIR=12,0󰐇󰐇//Set󰐇GPIO12󰐇to󰐇work󰐇as󰐇an󰐇input
Set Command
AT+SYSGPIOWRITE=<pin>,<level>
Response
If the configuration is successful, the command will return:
OK
If the IO pin is not in output mode, the command will return:
NOT󰐇OUTPUT!
ERROR
Parameter
<pin>: GPIO pin number
<level>:
0: low level
1: high level
Note
Please refer to ESP8266 Pin List for uses of AT+SYSGPIO-related commands.
Example
AT+SYSIOSETCFG=12,3,1󰐇󰐇//Set󰐇GPIO12󰐇to󰐇work󰐇as󰐇a󰐇GPIO
AT+SYSGPIODIR=12,1󰐇󰐇//Set󰐇GPIO12󰐇to󰐇work󰐇as󰐇an󰐇output
AT+SYSGPIOWRITE=12,1󰐇󰐇//Set󰐇GPIO12󰐇to󰐇output󰐇high󰐇level
Set Command
AT+SYSGPIOREAD=<pin>
Response
If the configuration is successful, the command returns:
+SYSGPIOREAD:<pin>,<dir>,<level>
OK
If the IO pin is not in GPIO mode, the command will return:
NOT󰐇GPIO󰐇MODE!
ERROR
Parameter
<pin>: GPIO pin number
<dir>:
0: sets the GPIO as an input
1: sets the GPIO as an output
<level>:
0: low level
1: high level
Espressif
! /5817
2017.05