Flashing LEDs With Raspberry Pi


Introduction: Flashing LEDs With Raspberry Pi

Flashing LEDs simple Project for kids.

What you Need:

  1. Two different colours LED
  2. 1k ohm resistor
  3. Breadboard
  4. Male to female Jumper cables
  5. Raspberry pi

Step 1: Python Program

import RPi.GPIO as GPIO

import time

# blinking function def blink(pin):





return # to use Raspberry Pi board pin numbers GPIO.setmode(GPIO.BOARD)

# set up GPIO output channel GPIO.setup(11, GPIO.OUT)

GPIO.setup(07, GPIO.OUT)

# blink GPIO4 10 times

# blink GPIO17 10 times for i in range(0,1000):

blink(07) blink(11)




    • Creative Misuse Contest

      Creative Misuse Contest
    • Water Contest

      Water Contest
    • Oil Contest

      Oil Contest

    3 Discussions

    I did something similar with an RGB LED. I would be more interested in a script to work under a web site. Any ideas?

    I'm just starting to learn python and I actually understand what your code is doing! raspberry pi's are cool!

    Great intro project. This was one of my first Raspberry Pi projects.