diff --git a/examples/realtime_1kHz_scope.py b/examples/realtime_1kHz_scope.py index 449ba4d..17cfe7d 100755 --- a/examples/realtime_1kHz_scope.py +++ b/examples/realtime_1kHz_scope.py @@ -33,7 +33,7 @@ def __init__(self,layout,title): self.timer = QtCore.QTimer() self.timer.timeout.connect(self.update) self.timer.start(100) - + def update(self): self.data=self.data[-500:] if self.data: @@ -67,7 +67,7 @@ def callBack(data): qtPanningPlot1.addData(data) # Get the Ardunio board. -board = Arduino(PORT) +board = Arduino(PORT,debug=True) # Set the sampling rate in the Arduino board.samplingOn(1000 / samplingRate) diff --git a/pyfirmata2/pyfirmata2.py b/pyfirmata2/pyfirmata2.py index cebfa67..ef26864 100755 --- a/pyfirmata2/pyfirmata2.py +++ b/pyfirmata2/pyfirmata2.py @@ -91,7 +91,7 @@ class Board(object): _parsing_sysex = False AUTODETECT = None - def __init__(self, port, layout=None, baudrate=57600, name=None, timeout=None): + def __init__(self, port, layout=None, baudrate=57600, name=None, timeout=None, debug=False): if port == self.AUTODETECT: l = serial.tools.list_ports.comports() if l: @@ -115,6 +115,8 @@ def __init__(self, port, layout=None, baudrate=57600, name=None, timeout=None): self.samplerThread = None self.sp = None raise Exception('Could not find a serial port.') + if debug: + print("Port=",port) self.samplerThread = Iterator(self) self.sp = serial.Serial(port, baudrate, timeout=timeout) # Allow 5 secs for Arduino's auto-reset to happen diff --git a/setup.py b/setup.py index 73f8723..bf2e795 100755 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ setup( name='pyFirmata2', - version='2.4.3', + version='2.4.4', description="Use your Arduino as a data acquisition card under Python", long_description=long_description, author='Bernd Porr',