Blink LED on Raspberry Pi 3 with Python and BCM Pins

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.
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)
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.
You can leave a response, or trackback from your own site.
Leave a Reply to the article

Learning & Certifications
Follow Us
Facebook Icon   Linked In Icon   Twitter Icon  
Validation and Recognition

Valid CSS! Valid HTML5!          Protected by Copyscape