I have a Raspberry Pi A+ and I'm running Raspbian GNU/Linux 8.0 (jessie).
When I use the gpio
command in bash I can connect to the GPIO ports, for example turning on a LED:
gpio mode 25 out
gpio write 25 1
gpio write 25 0
But when I try to do the same thing in Python 2.7 with RPi.GPIO
it does not work:
import RPi.GPIO as GPIO
import time
GPIO.setmode(GPIO.BCM)
GPIO.setwarnings(False)
led = 25
GPIO.setup(led, GPIO.OUT)
GPIO.output(led, True)
time.sleep(2)
GPIO.output(led, False)
GPIO.cleanup()
I have updated the python RPi.GPIO
libraries using these steps: https://sourceforge.net/p/raspberry-gpio-python/wiki/install/
How can I solve this issue and connect to the GPIO pins from Python?