Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Python Programming with Raspberry Pi
  • Toc
  • feedback
Python Programming with Raspberry Pi

Python Programming with Raspberry Pi

By : Sai Yamanoor, Srihari Yamanoor
close
Python Programming with Raspberry Pi

Python Programming with Raspberry Pi

By: Sai Yamanoor, Srihari Yamanoor

Overview of this book

Raspberry Pi Zero is a super-small and super-affordable product from Raspberry Pi that is packed with a plethora of features and has grabbed the notice of programmers, especially those who use Python. This step-by-step guide will get you developing practical applications in Python using a Raspberry Pi Zero. It will become a valuable resource as you learn the essential details of interfacing sensors and actuators to a Raspberry Pi, as well as acquiring and displaying data. You will get started by writing a Python program that blinks an LED at 1-second intervals. Then you will learn to write simple logic to execute tasks based upon sensor data (for example, to control a motor) and retrieve data from the web (such as to check e-mails to provide a visual alert). Finally, you will learn to build a home automation system with Python where different appliances are controlled using the Raspberry Pi. The examples discussed in each chapter of this book culminate in a project that help improve the quality of people’s lives.
Table of Contents (12 chapters)
close

What this book covers

Chapter 1, Getting Started with Python and the Raspberry Pi Zero, introduces the Raspberry Pi Zero and the Python programming language, its history, and its features. We will set up the Raspberry Pi for Python development and write the first program.

Chapter 2, Arithmetic Operations, Loops, and Blinky Lights, walks through the arithmetic operations in Python and loops in Python. In the second half of the chapter, we will discuss the Raspberry Pi Zero’s GPIO interface and then learn to blink an LED using a GPIO pin.

Chapter 3, Conditional Statements, Functions, and Lists, discusses the types of conditional statements, variables, and logical operators in Python. We will also discuss functions in Python. Then, we will learn to write a function that is used to control DC motors using the Raspberry Pi Zero.

Chapter 4, Communication Interfaces, covers all the communication interfaces available on the Raspberry Pi Zero. This includes the I2C, UART, and the SPI interface. These communication interfaces are widely used to interface sensors. Hence, we will demonstrate the operation of each interface using a sensor as an example.

Chapter 5, Data Types and Object-Oriented Programming in Python, discusses object-oriented programming in Python and the advantages of object-oriented programming. We will discuss this using a practical example.

Chapter 6, File I/O and Python Utilities, discusses reading and writing to files. We discuss creating and updating config files. We will also discuss some utilities available in Python.

Chapter 7, Requests and Web Frameworks, discusses libraries and frameworks that enable retrieving data from the Web. We will discuss an example, fetching local weather information. We will also discuss running a web server on the Raspberry Pi Zero.

Chapter 8, Awesome Things You Could Develop Using Python, discusses libraries and frameworks that enable retrieving data from the web. We will discuss examples such as fetching the local weather information. We will also discuss running a web server on the Raspberry Pi Zero.

Chapter 9, Let's Build a Robot!, shows how we built an indoor robot using the Raspberry Pi Zero as the controller and documented our experience as a step-by-step guide. We wanted to demonstrate the awesomeness of the combination of Python and the Raspberry Pi Zero’s peripherals.

Chapter 10, Home Automation Using The Raspberry Pi Zero, discusses four projects, a voice-activated personal assistant, a web framework-based appliance control, a physical activity motivation tool, and a smart lawn sprinkler. Through these projects we provide more examples of the new hardware and programming implementations.

Chapter 11, Tips and Tricks, concludes the book with useful hardware and software tips and shortcuts that will help you as you step beyond the concepts and exercises in this book to implement your own projects and solutions, or simply explore the areas of programming and hardware hacking as a hobby and a source of entertainment.

bookmark search playlist download font-size

Change the font size

margin-width

Change margin width

day-mode

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Delete Bookmark

Modal Close icon
Are you sure you want to delete it?
Cancel
Yes, Delete