6.3.1.6 Example - GPIO Configuration and Usage
The following code provides various examples of configuring and using GPIO.
- To configure pin 10 as an output, enter the
following command:
>AT+IOCFG=10,0,0 OK
- To read the current value of pin 10, enter the
following command:
>AT+DIGRD=10 +DIGRD:10,0 OK
- To configure pin 10 as High
and write a value of 1, enter the following
command:
>AT+DIGWR=10,1 OK
- To read the value of pin 10
and verify correct value written, enter the following
command:
>AT+DIGRD=10 +DIGRD:10,1 OK
- To configure pin 10 as High
and write a value of 1, enter the following
command:
- To enable Pull-up on Pin 10, enter the following
command:
>AT+DIGPU=10,1 OK