This repository has been archived on 2025-04-28. You can view files and clone it, but cannot push or open issues or pull requests.
CMS/5.MISC/usb读取数据画图/c.py
2024-11-19 17:19:21 +08:00

10 lines
189 B
Python

import struct
int_date = 0x8001
bin_data = bytes.fromhex(int_date)
signed_int = struct.unpack('<h', bin_data)[0]
print(signed_int)
float_data = int_date * 5.0 / 32768.0
print(float_data)