where can i add that???i found that to shut the Display on and off with a GPIO Pin i'm not real in programming and so on
#Prellzeit in Sekunden
KEY_BOUNCE_TIME=2
#GPIO-Pin des Tasters
PinButton=14
GPIO.setwarnings(False)
GPIO.setmode(GPIO.BCM)
GPIO.setup(PinButton,GPIO.IN)
DisplayOn=True
while True:
time.sleep(0.1)
print(GPIO.input(PinButton))
if GPIO.input(PinButton)==0:
#Taste wird gedrückt, wg. Pull-Up Widerstand beim Wert 0
DisplayOn=not DisplayOn
if DisplayOn==True:
print("Bildschirm EIN")
else:
print("Bildschirm AUS")
#Prelldauer für Taster warten
time.sleep(KEY_BOUNCE_TIME)
GPIO.cleanup()
sys.exit()