-
福利一海量deepseek资料包(持续更新)
-
福利二ComfyUI工作流&模型&插件
-
福利三AI工具集合包以及AI绘画解决方案
我们可以使用_thread来在ESP32中开发多进程的代码。如下:
import _thread
import time
import sys
import machine
# ---------- 这是一个线程要执行的代码 ------------
def test1(*args, **kwargs):
while True:
print("1")
time.sleep(1)
# ---------- 这是另一个线程要执行的代码 ------------
def test2(*args, **kwargs):
while True:
print("2")
time.sleep(1)
# ---------- 这里创建线程 ------------
thread_1 = _thread.start_new_thread(test1, (1,))
thread_2 = _thread.start_new_thread(test2, (2,))
# ---------- 这是主线程要执行的代码 ------------
while True:
print("3")
time.sleep(1)
440 浏览
您可以与在线客服进行沟通获得帮助
工作日:8:00~22:00节假日:9:00~20:00
微信号: mpyos01
Q Q号: 1401211620