Book Image

Raspberry Pi Zero Cookbook

Book Image

Raspberry Pi Zero Cookbook

Overview of this book

The Raspberry Pi Zero, one of the most inexpensive, fully-functional computers available, is a powerful and revolutionary product developed by the Raspberry Pi Foundation. The Raspberry Pi Zero opens up a new world for the makers out there. This book will give you expertise with the Raspberry Pi Zero, providing all the necessary recipes that will get you up and running. In this book, you will learn how to prepare your own circuits rather than buying the expensive add–ons available in the market. We start by showing you how to set up and manage the Pi Zero and then move on to configuring the hardware, running it with Linux, and programming it with Python scripts. Later, we integrate the Raspberry Pi Zero with sensors, motors, and other hardware. You will also get hands-on with interesting projects in media centers, IoT, and more.
Table of Contents (17 chapters)
Raspberry Pi Zero Cookbook
Credits
About the Author
About the Reviewer
www.PacktPub.com
Customer Feedback
Preface

Monitoring Twitter/e-mails to blink an LED


The Internet of Things concept is all about connecting the Web with the physical world. This goes in both directions: the data collection of physical devices goes up, and information from the Internet can be communicated out to physical devices. We can build on our previous example and have our LED circuits notify us when we receive an e-mail or tweet!

Getting ready

For hardware, you can use the same circuit as the previous recipe's circuit. Instead of a yellow LED, I used a blue one to notify me of Twitter messages.

If you followed the recipe in Chapter 4, Sending an e-mail from a Python Script, you should already have an app password for your Gmail account. If not, you can find out how in the Getting Ready section of the recipe.

I also used the Python library tweepy to manage incoming tweets. You can install this using pip:

sudo pip install tweepy

Lastly, you will need a Twitter account and authorization keys.

  1. Log in to your Twitter account, and go...