NINA-B31 series - Getting Started
UBX-18022394 - R02
Use case examples
Page 23 of 26
Configure, write, and read GPIO pin using AT command. See NINA-B3 System Integration Manual
[11] for GPIO pin id mapping.
Preconditions
•
Connect GPIO pin 2 on NINA-B31 (Device A) to GPIO pin 25 on NINA-B31 (Device B)
Set up NINA-B31 (Device A) GPIO pin
•
Check current configuration status of available GPIOs (result shows that all GPIOs are disabled)
AT+UGPIOC?
+UGPIOC:2,255
+UGPIOC:3,255
+UGPIOC:4,255
+UGPIOC:5,255
+UGPIOC:24,255
+UGPIOC:25,255
+UGPIOC:27,255
OK
•
Set pin 2 as an input, no resistor activated
AT+UGPIOC=2,1,0
•
Read the current value of pin 2 current value is 0 (zero)
AT+UGPIOR=2
+UGPIOR:2,0
Set up NINA-B31 (Device B) GPIO pin
•
Check current configuration status of available GPIOs (result shows that all GPIOs are disabled)
AT+UGPIOC?
+UGPIOC:2,255
+UGPIOC:3,255
+UGPIOC:4,255
+UGPIOC:5,255
+UGPIOC:24,255
+UGPIOC:25,255
+UGPIOC:27,255
OK
•
Set pin 25 as an output with initial value set to 0 (zero)
AT+UGPIOC=25,0,0
•
Set pin 25 to 1 (one)
AT+UGPIOW=25,1
Read the value of Device A’s pin 2
•
Read pin 2 (Device A), the read value is 1 (one)
AT+UGPIOR=2
+UGPIOR:2,1