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//SetGPIO12toworkasaGPIO
AT+SYSGPIODIR=12,0//SetGPIO12toworkasaninput
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:
NOTOUTPUT!
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//SetGPIO12toworkasaGPIO
AT+SYSGPIODIR=12,1//SetGPIO12toworkasanoutput
AT+SYSGPIOWRITE=12,1//SetGPIO12tooutputhighlevel
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:
NOTGPIOMODE!
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