You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

20 lines
369 B

from machine import Pin
from utime import sleep
led = Pin('LED', Pin.OUT)
state = False
# Setzt den Zustand der LED und wartet dann <wait> Sekunden.
def toggle_LED(state,wait):
if state:
led.on()
else:
led.off()
sleep(wait)
#Endlosschleife
while True:
state = not state # state hin- und herschalten
toggle_LED(state,0.5) # LED umschalten