pico-micropython-examples/multicore/multicore.py

13 wiersze
270 B
Python

2021-01-20 16:52:33 +00:00
import time, _thread, machine
def task(n, delay):
2023-02-28 11:59:47 +00:00
led = machine.Pin("LED", machine.Pin.OUT)
2021-01-20 16:52:33 +00:00
for i in range(n):
led.high()
time.sleep(delay)
led.low()
time.sleep(delay)
print('done')
_thread.start_new_thread(task, (10, 0.5))