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

Remaking your first Python-Arduino project with a GUI


Just to refresh your memory, I would like to remind you that we created a motion detection system that generated alerts by blinking the red LED when a motion was detected. While working with the project, we were printing the state of the proximity sensor onto the Python prompt. In this exercise, we are going to use the concepts that you learned in the previous exercises and we will create an interface for our project.

As part of this exercise, you have to connect the same circuit that we used in Chapter 3, The First Project – Motion-triggered LEDs. Make sure you have the exact same circuit with the PIR sensor and the LEDs before you move ahead. Once you are ready with your hardware, open the firstProjectWithGUI.py file from the code folder of this chapter. In the code, change the appropriate port values and run the GUI for the project.

As you can see in the pin assignments, we now have three digital pins—two of them as outputs and one as...