Explorar o código

Magnetdummysetup

Janek %!s(int64=3) %!d(string=hai) anos
pai
achega
925a8b71c4
Modificáronse 1 ficheiros con 7 adicións e 0 borrados
  1. 7 0
      raspberry-pi/sensors/magneticSensor.py

+ 7 - 0
raspberry-pi/sensors/magneticSensor.py

@@ -1,5 +1,6 @@
 import queue
 import time
+import threading
 
 from sensors.calibration import CalibrationStateMashine
 from sensors.connection import globalArduinoSlave
@@ -23,13 +24,19 @@ class MagneticSensor:
     #pass
 
   def start(self):
+    self.log_handler.log_and_print("start acoustic sensor")
     if not conn.isConnected():
       conn.open()
     conn.addRecvCallback(self._readCb)
+    self.dummyActive = True
+    dummyThread = threading.Thread(target=self._readCb_dummy)
 
   def _readCb(self, raw):
     print("mag: ", conn.getMagneticField())
 
+  def _readCb_dummy(self):
+    pass
+
   def calibrate(self, x, y):
     pass