Book Image

Yocto for Raspberry Pi

By : TEXIER Pierre-Jean, Petter Mabäcker
Book Image

Yocto for Raspberry Pi

By: TEXIER Pierre-Jean, Petter Mabäcker

Overview of this book

The Yocto Project is a Linux Foundation workgroup, which produces tools (SDK) and processes (configuration, compilation, installation) that will enable the creation of Linux distributions for embedded software, independent of the architecture of embedded software (Raspberry Pi, i.MX6, and so on). It is a powerful build system that allows you to master your personal or professional development. This book presents you with the configuration of the Yocto Framework for the Raspberry Pi, allowing you to create amazing and innovative projects using the Yocto/ OpenEmbedded eco-system. It starts with the basic introduction of Yocto's build system, and takes you through the setup and deployment steps for Yocto. It then helps you to develop an understanding of Bitbake (the task scheduler), and learn how to create a basic recipe through a GPIO application example. You can then explore the different types of Yocto recipe elements (LICENSE, FILES, SRC_URI, and so on). Next, you will learn how to customize existing recipes in Yocto/OE layers and add layers to your custom environment (qt5 for example).
Table of Contents (18 chapters)
Yocto for Raspberry Pi
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
3
Mastering Baking with Hob and Toaster

Controlling the lamp using the Raspberry Pi


At this point, we can control the relay locally from our board. Next, it's time to connect the lamp to our relay module.

Note

WARNING: This project require basic knowledge of electricals. We strongly discourage using high-voltage power if you don't have the knowledge or experience. The recommendation is to use a low-voltage 12-V power supply.

A one-channel relay module

Before we connect the lamp, we need to go through some basics about how the relay module will be used. Look closely at the following relay; it contains C, NC, and NO openings on the opposite side to where we inserted the GPIO jumper cables. These slots will be used to connect the lamp to the relay.

The C on the relay stands for common connection, and we will connect the power from our external power supply to this port. Next, we have NC and NO, which stand for normally closed and normally open. In our project, we will be using NO. The reason for this is that it will work like a switch...