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

The first article about STM32duino described “How to start with STM32 like Arduino. The second article of tutorial describes how to control GPIO – digital input, output and also PWM output. All articles about STM32duino: STM32duino I. – How to…

This is another continue of STM32 tutorial (STM32F746 tutorial). I would like to show example code for turn on/off LED with button. This example code is able to use for another microcontrollers by ST as STM32L100, L152, STM32F103, F407 and…

The first article from Tutorial: STM32F746 (STM32F7 Discovery) serie. I would like to describe how to turn on LED simply controlling GPIO. Why I began to write this tutorial and why I don’t want to use HAL or Standard Peripheral…

I had to create development board with SIM908 – GPS&GSM&GPRS module for diploma thesis. The board is designed as top side. It’s easier than top and bottom sides. On the board are pin headers which are connected to the SIM908…

In today article about Orange Pi Zero I want to show you how to blink of LED, measure the temperature by AD7415 sensor, which communicates through I2C and at the end we send some data to NRF24L01 through SPI. I…