pico-micropython-examples/multicore/multicore.py

13 wiersze
267 B
Python
Czysty Zwykły widok Historia

2021-01-20 16:52:33 +00:00
import time, _thread, machine
def task(n, delay):
led = machine.Pin(25, machine.Pin.OUT)
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))