Reader small image

You're reading from  Raspberry Pi Computer Architecture Essentials

Product typeBook
Published inMar 2016
Reading LevelIntermediate
Publisher
ISBN-139781784397975
Edition1st Edition
Languages
Right arrow
Authors (2):
Andrew K. Dennis
Andrew K. Dennis
author image
Andrew K. Dennis

Andrew K. Dennis is a full stack and cybersecurity architect with over 17 years' experience who currently works for Modus Create in Reston, VA. He holds two undergraduate degrees in software engineering and creative computing and a master's degree in information security. Andy has worked in the US, Canada, and the UK in software engineering, e-learning, data science, and cybersecurity across his career, and has written four books on IoT, the Raspberry Pi, and supercomputing. His interests range from the application of pataphysics in computing to security threat modeling. Andy lives in New England and is an organizer of Security BSides CT.
Read more about Andrew K. Dennis

View More author details
Right arrow

Integration with Arduino


As you may remember, we enabled the serial port on the Raspberry Pi earlier. We are now going to install a Python library called PySerial that allows us to communicate via Python.

This can be installed via apt-get:

sudo apt-get install python-serial

Tip

If you already have the latest version of the library, you will see this message:

python-serial is already the newest version.

Once you have this installed you can read more about the library at the PySerial website: https://pythonhosted.org/pyserial/.

Before we start writing applications with PySerial, we need to know where our Arduino is connected. You may have noticed that this information was provided in the Arduino IDE when you selected the serial port. If you used a different machine to write the sketch, however, there is a method we can use to find out where it is plugged in.

Start by running the following command:

ls /dev/tty*

This will output a list to your screen. Currently, the Arduino Uno isn't connected,...

lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Raspberry Pi Computer Architecture Essentials
Published in: Mar 2016Publisher: ISBN-13: 9781784397975

Authors (2)

author image
Andrew K. Dennis

Andrew K. Dennis is a full stack and cybersecurity architect with over 17 years' experience who currently works for Modus Create in Reston, VA. He holds two undergraduate degrees in software engineering and creative computing and a master's degree in information security. Andy has worked in the US, Canada, and the UK in software engineering, e-learning, data science, and cybersecurity across his career, and has written four books on IoT, the Raspberry Pi, and supercomputing. His interests range from the application of pataphysics in computing to security threat modeling. Andy lives in New England and is an organizer of Security BSides CT.
Read more about Andrew K. Dennis