如何解决树莓派 pico 中的“OSError: core1 in use”

时间:2021-02-28 17:18:39

标签: python micropython

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 测试多核功能时,弹出以下错误。

0 个答案:

没有答案
相关问题