I have two simple scripts, one in Python, one in bash to turn on and off a LED. I don't know what I'm doing wrong but if a run the bash script nothing happen, while the Python script It works flawless.
The strange thing is that if I run the Python script and after that I run the bash script...it works
after the reboot if I run the bash script first doesn't work
Is there something that I need to add in the /boot/config.txt ?
#!/bin/bash gpio mode 18 out echo LED on gpio -g write 18 1 sleep 1 echo LED off gpio -g write 18 0
import RPi.GPIO as GPIO import time GPIO.setmode(GPIO.BCM) GPIO.setwarnings(False) GPIO.setup(18,GPIO.OUT) print ("LED on") GPIO.output(18,GPIO.HIGH) time.sleep(1) print ("LED off") GPIO.output(18,GPIO.LOW)