Book Image

Python Programming for Arduino

Book Image

Python Programming for Arduino

Overview of this book

Table of Contents (18 chapters)
Python Programming for Arduino
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Integrating plots in the Tkinter window


Due to the powerful integration capabilities of Python, it is very convenient to interface the plots generated by the matplotlib library with the Tkinter graphical interface. In the last exercise of the previous chapter, we integrated Tkinter with pyFirmata to implement the project of Chapter 3, The First Project – Motion-triggered LEDs, with the GUI. In this exercise, we will extend this integration further by utilizing matplotlib. We will perform this action by utilizing the same Arduino circuit that we have been using in this chapter and expand the code that we used in the previous exercise. Meanwhile, we are not introducing any new methods in this exercise; instead we will be utilizing what you learned until now. Open the plotTkinter.py file from this chapter's code folder.

As mentioned earlier, the program utilizes three major Python libraries and interfaces them with each other to develop an excellent Python-Arduino application. The first interfacing...