logo

用statistics获取的L,A,B的平均值,A,B是有符号的,在取高第八位放入数组后,串口发出的数据不对,应该怎么取

2021-02-26 14:56
W
mz5o
31d30333-dfcc-4a70-80fd-277ffee87fc0.png
a8bb8089-7d6e-492b-9b51-6dd07abc8a4d.png
2021-02-26 20:48
I
网红小智智 星瞳科技

https://docs.python.org/zh-cn/3/library/struct.html

用标准库struct.pack函数。

https://cn.bing.com/search?q=python3+struct&go=%E6%8F%90%E4%BA%A4&qs=n&form=QBLH&sp=-1&pq=python3+struct&sc=1-14&sk=&cvid=C1FFBCB2FC64471DA866912C00DB50EF