Blink LED on Raspberry Pi 3 with Python and BCM Pins setup. This tutorial provide step by step instruction to perform LED Interfacing with Raspberry Pi and its Python program.
In this example we are using BCM setup for pin assignment.
Note: You have to connect your LED on pin number 11 on GPIO. Actually when you setup in BCM mode the pin numbers are from chip. The board pin and chip pin have different number assignments. It is better to use setup as BOARD, to make easy connection with the GPIO header on Raspberry Pi.
import time import RPi.GPIO as GPIO GPIO.setmode(GPIO.BCM) GPIO.setup(17,GPIO.OUT) while True: print("LED ON") GPIO.output(17,True) time.sleep(1) print("LED OFF") GPIO.output(17,False) time.sleep(1)