初始化提交

This commit is contained in:
王立帮
2024-07-19 10:16:00 +08:00
parent 4c7b571f20
commit 4a2d56dcc4
7084 changed files with 741212 additions and 63 deletions

View File

@@ -0,0 +1,27 @@
"""
UART Communication
MicroPython library for the UART_COMBoard to board communication
=======================================================
#Preliminary composition 20220903
dahanzimin From the Mixly Team
"""
_sdata=None
def send(uart,data,repeat=True):
global _sdata
if data != _sdata:
uart.write((str(data)+'\n'))
if not repeat:
_sdata=data
def recv(uart):
data = uart.readline()
if data:
data_str = data.strip()
try:
data_str=data_str.decode()
return eval(data_str)
except:
return data_str