6.3.1.6 Example - GPIO Configuration and Usage

The following code provides various examples of configuring and using GPIO.

  1. To configure pin 10 as an output, enter the following command:
    >AT+IOCFG=10,0,0
    OK
  2. To read the current value of pin 10, enter the following command:
    >AT+DIGRD=10
    +DIGRD:10,0
    OK
    1. To configure pin 10 as High and write a value of 1, enter the following command:
      >AT+DIGWR=10,1
      OK
    2. To read the value of pin 10 and verify correct value written, enter the following command:
      >AT+DIGRD=10
      +DIGRD:10,1
      OK
  3. To enable Pull-up on Pin 10, enter the following command:
    >AT+DIGPU=10,1
    OK