Problem controlling a GPIO with Python
Posted: Mon Dec 22, 2014 8:34 pm
I have the Raspberry Pi B with Raspbian installed.
Im trying to control the GPIO27 (number 13) with a script
The script on.py says:
import RPi.GPIO as GPIO
GPIO.setup(13, GPIO.OUT)
GPIO.output(13, True)
and off.py says:
import RPi.GPIO as GPIO
GPIO.setup(13, GPIO.OUT)
GPIO.output(13, False)
The problem is that the LED connected to the GPIO doesn't turn on.
However, if i follow the following commands, it turns on
root@raspberrypi:~# echo 27 > /sys/class/gpio/export
root@raspberrypi:~# echo out > /sys/class/gpio/gpio27/direction
root@raspberrypi:~# echo 1 > /sys/class/gpio/gpio27/value
I have no problem with python using others GPIOs, but i cant using this. What am i doing wrong?
Thanks
Im trying to control the GPIO27 (number 13) with a script
The script on.py says:
import RPi.GPIO as GPIO
GPIO.setup(13, GPIO.OUT)
GPIO.output(13, True)
and off.py says:
import RPi.GPIO as GPIO
GPIO.setup(13, GPIO.OUT)
GPIO.output(13, False)
The problem is that the LED connected to the GPIO doesn't turn on.
However, if i follow the following commands, it turns on
root@raspberrypi:~# echo 27 > /sys/class/gpio/export
root@raspberrypi:~# echo out > /sys/class/gpio/gpio27/direction
root@raspberrypi:~# echo 1 > /sys/class/gpio/gpio27/value
I have no problem with python using others GPIOs, but i cant using this. What am i doing wrong?
Thanks