Raspberry PI 2 GPIO.setup() exits without any error

我的未来我决定 提交于 2019-12-24 13:02:05

问题


I got a Pi2 and wanted to run the led example. But for some reason, the GPIO.setup(11, GPIO.OUT) always returns without any warnings or errors.

I run it in interactive mode with sudo, that's how I figured out it returned at the setup() function.

Can anybody help? Thanks in advance.

Here is the commands I run.

import RPi.GPIO as GPIO
import time                   

GPIO.setmode(GPIO.BOARD)       ## neither BOARD  nor BCM  works.
GPIO.setup(11, GPIO.OUT)       ##<<<< it returns here without error.

GPIO.output(11, GPIO.HIGH)
GPIO.cleanup()

回答1:


Ok, installing the beta version of RPi.GPIO fixed the problem.

sudo pip uninstall RPi.GPIO
sudo pip install hg+http://hg.code.sf.net/p/raspberry-gpio-python/code#egg=RPi.GPIO

More info: https://www.raspberrypi.org/forums/viewtopic.php?f=32&t=113014&p=773725



来源:https://stackoverflow.com/questions/33543893/raspberry-pi-2-gpio-setup-exits-without-any-error

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