DESKTOP-2QGM7IR\Lab01 5de3c3cc90 第一次提交
2025-04-09 09:49:42 +08:00

17 lines
216 B
Python

sdata = 0x43df
s1 = sdata >> 14
s2 = sdata & (0xffff >> 2)
if s1 == 0:
vl = s2 * 0.0001
elif s1 == 1:
vl = s2 * 0.01
elif s1 == 2:
vl = s2
elif s1 == 3:
vl = s2 / 100
else:
vl = 16383
print(vl)