from machine import Pin from utime import sleep led = machine.Pin(25, machine.Pin.OUT) state = False running = True #Endlosschleife led.off() while True: state = not state # state hin- und herschalten sleep(1.0) if state: print('LED on') led.on() # running = False else: print('LED off') led.off()