我正在尝试使用python并导入Adafruit_BBIO.GPIO并导入Adafruit_BBIO.ADC以便在我写给其他人时从某些引脚读取。但我一直收到这个错误:
追踪(最近一次通话): 文件“wajeeh.py”,第4行,in ADC.setup() RuntimeError:无法设置ADC系统。可能的原因是: - 加载了具有冲突引脚映射的斗篷 - 加载了一个设备树对象,该对象使用与片段相同的名称: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
答案 0 :(得分:3)
类似的问题已在更高版本的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