Opens in a new tab

Raspberry Pi – LED Turn On/Off and Blinking

Blinking LED is basis any programming. This is complete code for blinking LED, turn ON or turn OFF LED on GPIO 7. The program is written in python language and you find complete tutorial.

You have to create file *.py in the home folder.

Copy this code:

This command is used for running blink.py:

Control program is easy. You will have to write number 1- Turn ON LED, 2 -Blinking LED a 3 – Turn OFF LED.

Choice 2 – You have to specify number repeating and blinking period.

If you turn ON LED and run program again, appears this message:

This message is no problem, because only highlights that the GPIO 7 is used.

Source of:

Pinout of Raspberry Pi:

https://projects.drogon.net/raspberry-pi/wiringpi/pins/

Original program:

http://www.thirdeyevis.com/pi-page-2.php

Share the article:
Show your
Maker soul!
Buy a T-Shirt
Coffee for Chiptron
Give a boost to the next article

Related Articles

Download 2 PHP files and 1 python script If you want to control GPIO through webpage, you have to read this article. I will describe how to control GPIO from webpage. You can download 2 PHP files and 1 python…

Trends