This commit is contained in:
xyj 2023-12-13 17:38:11 +08:00
parent 65a735227e
commit 3a306e31b7
1 changed files with 1 additions and 1 deletions

View File

@ -164,7 +164,7 @@ def get_data():
# print('返回的数据2进制:', return_data) # print('返回的数据2进制:', return_data)
# 二进制转换为16进制010304010802307b79 # 二进制转换为16进制010304010802307b79
return_data_hex = str(return_data.hex()) return_data_hex = str(return_data.hex())
# print('返回的数据转换为16进制:', return_data_hex) print('返回的数据转换为16进制:', return_data_hex)
# print("当前风向为:", int(return_data_hex[10:14], 16) ) #单位mm # print("当前风向为:", int(return_data_hex[10:14], 16) ) #单位mm
winddirection_data = int(return_data_hex[6:10], 16) / 10 winddirection_data = int(return_data_hex[6:10], 16) / 10
time.sleep(5) time.sleep(5)