read serial port and display data in tkinter gui
This is related to a couple of my previous questions but different enough to use a new thread. I'm trying to read the serial out put of a legacy piece of hardware and display it in a tkinter GUI. I've made a lot of progress with all your help but this current problem has me baffled. The hardware is basically a timer. I've opened the serial port as ttyUSB0)
Code:
ser = serial.Serial( Code:
Str = ser.readline(8) Quote:
Now the problem: When the GO button is pressed an integer 60 is passed but the number of spaces before and after changes with each word. This was done to cause the integer 60 to move down a digital display board. The problem is that this causes the 60 to jump around on the GUI display and when the number wraps around the EOL marker the GUI splits the number into two lines. Then somehow the read gets out of sync with the word spacing and even the floating point seconds nomber is moved or line wraped. The debug print looks like this: Code:
b' 60\r ' |
Don't read fix number of bytes, read lines. In some other topic you have already found ser.eol= '\r' (or similar), now use that.
|
Thanks!
I also found that readline.replace(b"\r",b"\r\n") works |
All times are GMT -5. The time now is 07:57 PM. |