Raspberry Pi Pico PIO State Machine
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
331 B

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()