The Label() widget – monitoring I/O pins

Arduino projects often deal with real-time systems and are required to continuously monitor input values from digital and analog pins. Therefore, if these values are being displayed on a graphical interface, they need to be updated periodically or when the state of a pin changes.

If you observe the previous GUI exercises, you will notice that we initialized the root window using mainloop() at the end of the code, which started the Tkinter loop and initialized all the widgets with the updated values. Once the mainloop() was initialized, we did not use any other Tkinter class or method to periodically update the widgets with the latest values.

In this exercise, we will use a potentiometer to provide variable ...

Get Python Programming for Arduino now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.