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

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