python - 在 ubuntu 14.04 中使用 python Adafruit_BBIO GPIO 和 ADC 以及 BeagleBone Black 时出错

标签 python ubuntu-14.04 beagleboneblack

我正在尝试使用 python 并导入 Adafruit_BBIO.GPIO 和导入 Adafruit_BBIO.ADC 来从某些引脚读取数据,同时向其他引脚写入数据。但我不断收到此错误:

回溯(最近一次调用最后一次): 文件“wajeeh.py”,第 4 行,位于 ADC.setup() 运行时错误:无法设置 ADC 系统。可能的原因有: - 加载了具有冲突引脚映射的 Cape - 加载一个设备树对象,该对象对片段使用相同的名称:helper

这是我的代码:

import Adafruit_BBIO.GPIO as GPIO #import GPIO Library
import Adafruit_BBIO.ADC as ADC

ADC.setup()

outPinA = "P9_12"                    #set outPinA 
outPinB = "P9_14"                   #set outPinB  

GPIO.setup(outPinA, GPIO.OUT)       #make outPin an Output
GPIO.setup(outPinB, GPIO.OUT)

while 1:
    GPIO.output(outPinA, GPIO.HIGH)
    GPIO.output(outPinB, GPIO.LOW)
    sleep(10)
    GPIO.output(outPinA, GPIO.LOW)
    GPIO.output(outPinB, GPIO.LOW)
    sleep(10)
    GPIO.output(outPinA, GPIO.LOW)
    GPIO.output(outPinB, GPIO.HIGH) # Set outPin LOW
    sleep(10)                       
    GPIO.output(outPinA, GPIO.LOW)
    GPIO.output(outPinB, GPIO.LOW)
    sleep(10)                       
GPIO.cleanup()                     #Release your pins

最佳答案

类似的问题已在 ADC 的更高版本中得到解决。请参阅:issue 90

尝试卸载 Adafruit_BBIO,然后从 git 存储库安装:

pip uninstall Adafruit_BBIO
git clone https://github.com/adafruit/adafruit-beaglebone-io-python/
cd adafruit-beaglebone-io-python
python setup.py install

关于python - 在 ubuntu 14.04 中使用 python Adafruit_BBIO GPIO 和 ADC 以及 BeagleBone Black 时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33791856/

相关文章:

python-2.7 - 如何设置python安装路径?

beagleboneblack - 写: no buffer space available socket-can/linux-can

python-2.7 - OpenCV 2.4.8 (Python) 确定箭头的方向

python - 为什么删除列时 Flask-migrate 无法升级

python - 在Ocaml写的程序中调用python写的程序

python - 用pylab或matplotlib指定savefig的路径

python - 尝试运行 bokeh-server 时出错

python - 为什么这些 for 和 while 循环的迭代方式不同?

linux - nginx 服务器上 vsftpd 中 root 的默认目录

python - 回复 : Getting the Adafruit_I2C Import Changed Into Another GPIO Layout