I have a problem with the control of the GPIOs.
The ports are automatically active and the LED turn on as soon as I initialize them as "outputs". The modification of the values has no influence on the LED status.
First try with the console:
export the GPIO:
sudo echo 16 >/sys/class/gpio/export
Change the GPIO to OutPut:
cd /sys/class/gpio/gpio16
sudo nano direction
(Change the value from "in" into "out" and save it)
==> GPIO status is changing directly to active 3,3V and the LED turns on.
Change the GPIO status by changing the Value:
sudo nano value
(Modify from "0" to "1" or from "1" to "0" an save the file)
==> The stauts of the GPIO is not changing and the LED is constantly turned on. It is not possible to turn it off.
2. try with a Python script:
import RPi.GPIO as GPIO
import time
GPIO.setmode(GPIO.BCM)
pins = [16,26]
GPIO.setup(pins, GPIO.OUT)
for pin in pins :
GPIO.output(pin, GPIO.HIGH)
time.sleep(1)
GPIO.output(pin, GPIO.LOW)
time.sleep(1)
if not GPIO.input(pin):
print("Pin "+str(pin)+" is working" )
time.sleep(1)
time.sleep(1)
GPIO.cleanup()
When I run this script there is the same problem. The LEDs turn on at the initialization "GPIO.setup(pins, GPIO.OUT)" and stay active untill the end and turn off at "GPIO.cleanup()". The value High and Low have no influence and no switching is happening.
What I am doing wrong? I have the same script running on my old Raspberry 2 and there it is running. But now on my new Raspberry 3 I suddenly have these problems.
I guess there are some drivers, programs or settings missing. Does anybody know what to do?
Thanks a lot in advance, Mathias