从 ADC 读取要使用的引脚
reading from ADC which pins to use
我正在尝试连接 this analog to digital converter to my raspberry pi (version b+) but everything I have read seems to use different pins from what I assumed based on this pinout 网站。有人可以告诉我使用哪些引脚(GPIO.BOARD 样式)吗?从 adc 读取的 python 代码的一个简单示例也将不胜感激。
看起来 ADC 通过 I2C 进行通信。 RPi B+ 可以在 python 中使用 SMBUS(就像在你的问题中的 link 中一样)通过 I2C 进行通信。我想这个 ADC 上的两条线是 V+ 和 GND,另外两条线对应于 SCL(I2C 的时钟线)和 SDA(I2C 的数据线),在 B+ 上是物理引脚 3(SDA)和5(SCL).
编辑 1:
连接后,您将需要 ADC 的地址。你可以用
得到它
i2cdetect -y 1
在 shell.
有关示例代码,请查看 this instructable。
我正在尝试连接 this analog to digital converter to my raspberry pi (version b+) but everything I have read seems to use different pins from what I assumed based on this pinout 网站。有人可以告诉我使用哪些引脚(GPIO.BOARD 样式)吗?从 adc 读取的 python 代码的一个简单示例也将不胜感激。
看起来 ADC 通过 I2C 进行通信。 RPi B+ 可以在 python 中使用 SMBUS(就像在你的问题中的 link 中一样)通过 I2C 进行通信。我想这个 ADC 上的两条线是 V+ 和 GND,另外两条线对应于 SCL(I2C 的时钟线)和 SDA(I2C 的数据线),在 B+ 上是物理引脚 3(SDA)和5(SCL).
编辑 1:
连接后,您将需要 ADC 的地址。你可以用
得到它
i2cdetect -y 1
在 shell.
有关示例代码,请查看 this instructable。