O'Reilly logo

Raspberry Pi LED Blueprints by Agus Kurniawan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Blinking LEDs

In this section, we will build a simple app that interacts with Raspberry Pi GPIO. We will use three LEDs, which are attached to the Raspberry Pi 2 board. Furthermore, we will turn the LEDs on/off sequentially.

The following hardware components are needed:

  • Raspberry Pi 2.(you can change this model)
  • Three LEDs of any color
  • Three resistors (330 Ω or 220 Ω)
    Blinking LEDs

The hardware wiring can be implemented as follows:

  • LED 1 is connected to Pi GPIO18
  • LED 2 is connected to Pi GPIO23
  • LED 3 is connected to Pi GPIO24

The following image shows the hardware connection for LED blinking:

Now you can write a program using WiringPi with Python. The following is the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required