Lab 22. OAP GPIO get
Expected completion time of this lab:
.
Enable the D0 GPIO
This step enables the GPIO input pin. It is a required step for reading its value or activating notifications.
The D0 GPIO corresponds to the DP2 pin on the DC9003 SmartMesh Eval/Dev Mote.
create a flow which issues:
an HTTP PUT request
to URL http://127.0.0.1:8080/api/v1/oap/{{mote}}/digital_in/D0
with payload
{ sampleCount: 1, rate: 10000, enable: 1, dataFormat: 0 }
Open the SmartMesh IP Tools Guide (http://www.linear.com/docs/42453), looks for section "/digital_in". What does dataFormat 0 mean?
Read the value of the D0 GPIO
create a flow which issues:
an HTTP GET request
to URL http://127.0.0.1:8080/api/v1/oap/{{mote}}/digital_in/D0
Issue the command to your mote
What is the state (value) of your pin?
Connect a jumper between the
DP2andVSUPPLYpins. Make sure you can read the value of digital_in/D0 to be high.Connect a jumper between the
DP2andGNDpins. Make sure you can read the value of digital_in/D0 to be low.