How to read analog data from GPIO, Android things

I tried to read analog data from gpio, but saw only a method that returns signal strength as LOW or HIGH (boolean). Could not find a solution in the documentation and links to the code. Is it possible now?

+4
source share
3 answers

Raspberries Pi 3 does not have an analog-to-digital converter , so you can only get logical values ​​(high / low) from your GPIO . Therefore, to obtain analog data, you need to use an external ADC module in your project.

EDIT: I found this interesting blog blog showing how to measure analog input on Android Things.

+3
source

For Raspberry Pi, you will need to use an analog-to-digital converter such as the ADS1115.

+1
source

If you are still looking, I wrote a class and sample for the ADC Adaptivity MCP3008

https://github.com/PaulTR/AndroidThingsMCP3008ADC

+1
source

Source: https://habr.com/ru/post/1664982/


All Articles