Book Image

Getting Started with Python and Raspberry Pi (Redirected from Learning Python By Developing Raspberry Pi Applications)

By : Nixon
Book Image

Getting Started with Python and Raspberry Pi (Redirected from Learning Python By Developing Raspberry Pi Applications)

By: Nixon

Overview of this book

The Raspberry Pi is one of the smallest and most affordable single board computers that has taken over the world of hobby electronics and programming, and the Python programming language makes this the perfect platform to start coding with. The book will start with a brief introduction to Raspberry Pi and Python. We will direct you to the official documentation that helps you set up your Raspberry Pi with the necessary equipment such as the monitor, keyboard, mouse, power supply, and so on. It will then dive right into the basics of Python programming. Later, it will focus on other Python tasks, for instance, interfacing with hardware, GUI programming, and more. Once you get well versed with the basic programming, the book will then teach you to develop Python/Raspberry Pi applications. By the end of this book, you will be able to develop Raspberry Pi applications with Python and will have good understanding of Python programming for Raspberry Pi.
Table of Contents (13 chapters)
12
Index

Digital electronics

Before we start interfacing the Pi to any electronics, we will first take a look at some of the fundamentals of digital electronics.

Logic in digital electronics is composed of two states: high and low. Typically, low is represented by the signal being close to the ground (0V) and high is represented by being close to a reference voltage (usually, the operating voltage of the logic device). In the case of the Raspberry Pi, it is 3.3V.

Note

Be sure that any device that you connect to the Raspberry Pi via the GPIO port can operate at 3.3V.

The point at which a signal changes between these two states is known as an edge. This can either be rising or falling depending on the direction of the state change, as shown in the following diagram:

Digital electronics

Another concept we will see later in this chapter is Pulse Width Modulation (PWM). This is the concept of simulating an analog signal (a constant signal at a voltage between the high and the low levels) by creating a digital signal and varying...