Building the circuit

The following diagram shows how you can connect an LED to the BCM_GPIO pin 18 (physical pin 12) of the Raspberry Pi 3:

LED connected to the BCM_GPIO 18 of the Raspberry Pi 3

Connect the positive leg (the longer leg) of the LED to the physical pin 12 (BCM_GPIO PIN 18) of the Raspberry Pi.

Connect the negative leg (the shorter leg or the leg adjacent to the flat edge on the LED's plastic housing) of the LED to the physical pin 6 of the Raspberry Pi 3 through a 330 Ohm resistor.

Make sure that the positive and negative ends are properly seated on the breadboard. If not, the LED will not glow.

Following screenshot shows the ...

Get Hands-On Internet of Things with Blynk now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.