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

Method 2 – using Python and Firmata


In the previous chapter, we discussed the benefits of using Python programming that is assisted by Firmata over using native Arduino sketches. The Python-based programming approach provides tangible experience when performing any algorithmic or parametric changes. In this section, we are going to explore these benefits and also learn important Python programming paradigms.

The project setup

Let's make sure that you have done the following before we go ahead with Python programming:

  • Made sure that the hardware components are set up, as described in the system design

  • Connected the Arduino to your computer using a USB cable

  • Uploaded the StandardFirmata sketch back to Arduino

  • Made sure that you have Python and the Python packages (pySerial and pyFirmata) installed on your computer

  • Obtained a text editor to write Python codes

Working with Python executable files

In the previous chapters, we explored Python programming using the interactive Python interpreter. However...