import time, _thread, machine
def task(n, delay):
led = machine.Pin(16, 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))
Traceback (most recent call last):
File "<stdin>", line 12, in <module>
OSError: core1 in use
在 MicroPython v1.14 中使用 _thread 测试多核功能时,弹出以下错误。