|
@@ -75,7 +75,7 @@ class SerialConnection:
|
|
class ArduinoSlave(SerialConnection):
|
|
class ArduinoSlave(SerialConnection):
|
|
def __init__(self):
|
|
def __init__(self):
|
|
super().__init__()
|
|
super().__init__()
|
|
- self.sensorData = [0] * 12
|
|
|
|
|
|
+ self.sensorData = [0] * 13
|
|
self._recvCbs = []
|
|
self._recvCbs = []
|
|
self._t = None
|
|
self._t = None
|
|
|
|
|
|
@@ -130,7 +130,7 @@ class ArduinoSlave(SerialConnection):
|
|
if data:
|
|
if data:
|
|
data = str(data, "ASCII")
|
|
data = str(data, "ASCII")
|
|
vals = data.split('\t')
|
|
vals = data.split('\t')
|
|
- if vals[0] == "DATA:":
|
|
|
|
|
|
+ if vals[0] == "DATA:" and len(vals) >= 13:
|
|
self.sensorData = vals[1:]
|
|
self.sensorData = vals[1:]
|
|
for cb in self._recvCbs:
|
|
for cb in self._recvCbs:
|
|
cb(self.sensorData)
|
|
cb(self.sensorData)
|