#!/usr/bin/python
import RPi.GPIO as GPIO
import time

GPIO.setmode(GPIO.BCM)

pinList = [21, 22, 23, 24]

for i in pinList:
    GPIO.setup(i, GPIO.OUT)
    GPIO.output(i, GPIO.HIGH)

Gecikme = 0.1

try:
   tur = 5
   while (tur > 0):

      print '   Kalan  Tur Sayisi:', tur 
      
      for i in pinList:
         GPIO.output(i, GPIO.LOW)
         time.sleep(Gecikme);

      pinList.reverse()

      for i in pinList:
         GPIO.output(i, GPIO.HIGH)
         time.sleep(Gecikme);

      pinList.reverse()
      tur = tur - 1

except KeyboardInterrupt:
  print "  Cikis"

  GPIO.cleanup()
