Jan-07-2021, 05:22 PM
(Jan-07-2021, 04:00 PM)Kurta Wrote: I can live without the while
I just want the panel to display once a minute or button press
readline() blocks waiting for a newline. This will make your GUI freeze whenever you are reading from the serial port. It is better than freezing forever, but it still does not make for a good GUI experience.
The best solution, I think, is to start a separate process to handle the serial port. The process would uses a queue to communicate with the GUI process. Your GUI application would periodically check if there is any data in the serial queue and display the data when found.
Since many Arduino applications involve communicating with hardware I would expect there to already be a solution to this problem. It would be worth you while to spend some time searching for what others have done. Just looking around for a little while I ran across these:
https://www.instructables.com/UART-Contr...ter-serial