Add debugging method
This commit is contained in:
@@ -37,4 +37,14 @@ class SerialReader:
|
||||
line = self.serial.readline()
|
||||
if line:
|
||||
data = line.decode('utf-8', errors='ignore')
|
||||
self.__notify(data)
|
||||
self.__notify(data)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
def callback(data):
|
||||
print(data)
|
||||
|
||||
reader = SerialReader("/dev/ttyUSB1", 57600)
|
||||
reader.subscribe(callback)
|
||||
reader.start()
|
||||
Reference in New Issue
Block a user