import queue import time from sensors.connection import globalArduinoSlave import logHandler conn = globalArduinoSlave() class MagneticSensor: def __init__(self, conf): self.conf = conf self.queue = queue.Queue() self.log_handler = logHandler.get_log_handler() # neu #pass def start(self): if not conn.isConnected(): conn.open() conn.addRecvCallback(self._readCb) def _readCb(self, raw): print("mag: ", conn.getMagneticField()) def calibrate(self, x, y): pass def read(self): return conn.getMagneticField() def stop(self): # neu self.log_handler.log_and_print("stop magnetic sensor") conn.close