Commit 575f612c authored by root's avatar root
Browse files

update baterry_sensor 1 y 2

parent 7e505538
......@@ -58,7 +58,9 @@ if __name__ == '__main__':
rx=m.raw(tx)
if len(rx) > 7:
length= struct.unpack('>B',rx[2])[0]
if len(rx) > 5 and length == 4:
v = struct.unpack('>H',rx[3:5])[0] # miliVolts
t = struct.unpack('>H',rx[5:7])[0] # deciDegree Celsius
......
......@@ -58,8 +58,9 @@ if __name__ == '__main__':
t1 = None # Temperature 1
t2 = None # Temperature 2
length= struct.unpack('>B',rx[2])[0]
if len(rx) > 5:
if len(rx) > 5 and length == 6:
i = struct.unpack('>H',rx[3:5])[0] # deciAmps
t1 = struct.unpack('>H',rx[5:7])[0] # deciDegree Celsius
t2 = struct.unpack('>H',rx[7:9])[0] # deciDegree Celsius
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment