I have a RGB LED connected to the Pi's GPIO pins as stated on the code below. For this simple script, the GPIO18 pin is connected to the RED Led and to activate it it must be set to 0.
import RPi.GPIO as GPIO import time GPIO.setmode(GPIO.BCM) #Usar indice do GPIO em vez do indice dos pinos GPIO.setup(18,GPIO.OUT) #Ativa GPIO18 como saida - LED R GPIO.setup(23,GPIO.OUT) #Ativa GPIO23 como saida - LED G GPIO.setup(24,GPIO.OUT) #Ativa GPIO24 como saida - LED B GPIO.output(18,False) time.sleep(10) GPIO.cleanup()
When I run it, the script does as intended, the Red LED lights on for 10 seconds and then lights off.
Although, when I run the script I immediately get the message "The system is going down for system halt NOW!" and as soon as the script does it's things, the Raspberry Pi shuts down.
This happens with every script that deals with GPIO pins. I've checked if everything is correctly wired a million of times and it is. I've also tested each LED connectivity individually and everything is working fine.
What do you think might be the problem?
EDIT: I should mention that every script has worked flawlessly before without this problem.