add micropython demo on bearpi board

This commit is contained in:
KY-zhang-X
2022-09-29 12:15:02 +08:00
parent afeaebd1b9
commit 3e4ceb8afe
49 changed files with 14399 additions and 2 deletions

View File

@@ -0,0 +1,19 @@
import _thread
lock = _thread.allocate_lock()
n_thread = 4
n_finished = 0
def thread_entry(no):
print(no)
with lock:
global n_finished
n_finished += 1
if __name__ == '__main__':
for i in range(n_thread):
_thread.start_new_thread(thread_entry, (i,))
while n_finished < n_thread:
pass
print("done")