Reading in sensors - need to decode 18 bit stream into....floats?

This commit is contained in:
Lucas Oskorep
2019-09-30 09:58:50 -05:00
parent d7ed8fc73e
commit c9ed476230
3 changed files with 971 additions and 7 deletions
+11
View File
@@ -0,0 +1,11 @@
import struct
from bitstring import BitArray
test = b"5\x01\'\x02\xfd\x02/\x02e\x01%\xfd8\xc8Xn<\xc3"
# test = b'\x0f\x00'
# print(len(test))
# first = test[:4]
#
# last = test[14:]
#
print(BitArray(test).bin[:1])