Create this /storage/scripts/status_led.py :
Python Display More#!/usr/bin/python import sys sys.path.append('/storage/.kodi/addons/virtual.rpi-tools/lib') import RPi.GPIO as GPIO # Replace YOUR_CHOSEN_GPIO_NUMBER_HERE with the GPIO pin number you wish to use. # Make sure you know which rapsberry pi revision you are using first. # The line should look something like this e.g. "gpio_number = 7". led_gpio_number = 13 # Use BCM pin numbering (i.e. the GPIO number, not pin number). # WARNING: this will change between Pi versions. # Check yours first and adjust accordingly. GPIO.setmode(GPIO.BCM) # Switch LED on. # LED will switch off automatically at shutdown by using normal GPIO state. GPIO.setup(led_gpio_number, GPIO.OUT) GPIO.output(led_gpio_number, True)
Thank you very much for the guide!
I came up with a problem that after I changed the led GPIO to 4 (BCM Mode), the LED was blinking slightly when Pi shutdown. But GPIO 13 works well. I can hardly find anything about the GPIO state after Pi shutdown. Is there any way to solve it cause I want to make the wires more concentrated.
Thank a lot!