loading

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):

GPIO.output(pin,GPIO.HIGH)

time.sleep(0.25)

GPIO.output(pin,GPIO.LOW)

time.sleep(0.25)

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)

GPIO.cleanup()

<p>I did something similar with an RGB LED. I would be more interested in a script to work under a web site. Any ideas?</p>
I'm just starting to learn python and I actually understand what your code is doing! raspberry pi's are cool!
<p>Great intro project. This was one of my first Raspberry Pi projects. </p>

About This Instructable

781views

9favorites

License:

More by Alpesh Soni:Arduino Flashing LED Project for kids  Flashing LEDs with Raspberry Pi 
Add instructable to: