Re: Serial communication problem
Phil <[email protected]>
| Newsgroups | gmane.comp.python.tutor |
|---|---|
| Message-ID | <[email protected]> |
On 13/12/23 04:46, Alan Gauld via Tutor wrote: Thank you again Alan, > I also don't much like the fact that you do two reads inside > the while True loop. This was the cause of the problem. The read function is non blocking which explains why I could only read the first byte before things went awry. The cure was to make the second read blocking and I felt like a real dill for not realising that sooner. I also got rid of the class structure which made the code far simpler. There was also a logic error in the python code and the length of that code has been greatly reduced as well. Thank you for your interest in my problems and your time is not wasted. I often pick up useful tips from the answers to other's questions. By the way, the object of this exercise was to gain experience in reading and writing to the pico via USB and then to build a dashboard to monitor a cyclone that has since crossed the coast a little north of my current location. The dashboard also works correctly and the cyclone has veered away from it's initial predicted course. -- Regards, Phil _______________________________________________ Tutor maillist - [email protected] To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor