@sdetweil sry about that
@uros76 i hope thats not the problem
import RPi.GPIO as GPIO
import time
import datetime
switch=11
GPIO.setmode(GPIO.BOARD)
GPIO.setup(switch, GPIO.IN)
try:
while True:
if GPIO.input(switch) == 1:
now = datetime.datetime.now()
print(now.strftime("%Y-%m-%d %H:%M:%S"), "something")
time.sleep(5)
except KeyboardInterrupt:
print("Bye Bye")
finally:
GPIO.cleanup()
thanks for the help