Error using python Adafruit_BBIO GPIO and ADC and BeagleBone Black in ubuntu 14.04

↘锁芯ラ 提交于 2019-12-11 12:24:15

问题


I'm trying to use python and import Adafruit_BBIO.GPIO and import Adafruit_BBIO.ADC to read from some pins while I write to others. But I keep getting this error:

Traceback (most recent call last): File "wajeeh.py", line 4, in ADC.setup() RuntimeError: Unable to setup ADC system. Possible causes are: - A cape with a conflicting pin mapping is loaded - A device tree object is loaded that uses the same name for a fragment: helper

here is my code:

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

回答1:


A similar issue has been solved in a later version of ADC. See: issue 90

Try uninstalling Adafruit_BBIO, and then installing from the git repository:

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


来源:https://stackoverflow.com/questions/33791856/error-using-python-adafruit-bbio-gpio-and-adc-and-beaglebone-black-in-ubuntu-14

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!