Book Image

Raspberry Pi LED Blueprints

By : Agus Kurniawan
Book Image

Raspberry Pi LED Blueprints

By: Agus Kurniawan

Overview of this book

Table of Contents (14 chapters)
Raspberry Pi LED Blueprints
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Introducing a 7-segment display


In general, a 7-segment display consists of seven LEDs, and an additional LED is used for a dot (DP pin). This then allows us to display each of the 10 decimal digits 0 to 9 on the same 7-segment display.

There are two types of LED 7-segment displays, named common cathode (CC) and common anode (CA). Each LED has two connecting pins: the anode and the cathode. A sample LED datasheet can be found at http://www.kitronik.co.uk/pdf/7_segment_display_datasheet.pdf.

We can show a number on the 7-segment display by combining LED lighting through its pins. For instance, if we want to display the number 7, we should turn on LEDs a, b, and c. To turn an LED on/off, we can use Raspberry Pi GPIO:

Furthermore, we are going to build a program to display the numbers 0 to 9 using Python. The following is the hardware required: