Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
试图从 gpio 读取模拟数据,但只看到一种将信号强度返回为 LOW 或 HIGH(布尔值)的方式。在文档和代码参考中找不到任何解决方案。现在甚至可能吗?
Raspberry Pi 3 没有模数转换器,因此您只能从其GPIO获取布尔值(高/低) 。因此,为了获得模拟数据,您需要在项目中使用外部 ADC 模块。
编辑:我发现这篇有趣的博文展示了如何在 Android Things 上测量模拟输入。
对于 Raspberry Pi,您需要使用 ADS1115 等模数转换器。
如果您还在寻找,我为 Adafruit MCP3008 ADC 编写了一个类和示例
https://github.com/PaulTR/AndroidThingsMCP3008ADC