This command will read the value of all ADC pins and maps the input voltage (in the range of 0V to 3.3V) to an integer between 0 to 2^16-1. The default queue for this command is the high priority queue. If the queue parameter is set to 0, then the command will be submitted to the normal priority queue.
Key, value pairs
Key
Value
Required
Description
"cmd"
"adc"
Yes
Reads ADC pins.
"id"
Int (>0)
No
Id can be any positive integer. If id is not provided, status of the command will not be returned from the controller.
"queue"
0 / 1
No
If the value is 0, the command will be submitted to the normal priority queue. Otherwise, it will be submitted to the high priority queue. The default value 1.
Response
Key
Value
Description
"cmd"
"adc"
In response to adc command a message is returned where the cmd field is set to adc and the values of all ADC pins are included in it.
"id"
Int (>0)
Same id as the original command.
"adc0", "adc1", "adc2", "adc3", "adc4"
Int (>=0 and <= 2^16 - 1)
Value of ADC pins as an integer between 0 and 2^16 - 1.
Example
{"cmd":"adc", "id":1}
The response will include the value of all ADC pins.