import RPi.GPIO as GPIO
import time
GPIO.setwarnings(false)
GPIO.setmode(GPIO.BOARD)
GPIO.setup(22,GPIO.OUT)
GPIO.setup(15,GPIO.OUT)
GPIO.setup(38,GPIO.OUT)
GPIO.setup(36,GPIO.OUT)
GPIO.setup(13,GPIO.OUT)
GPIO.setup(11,GPIO.OUT)
GPIO.setup(40,GPIO.OUT)
GPIO.setup(7,GPIO.OUT)
for i in range(1, 3):
    while(i%2==1):
        pdd=GPIO.PWM(22,50)
        pdd.start(6)
        pdd.ChangeDutyCicle(12)
        time.sleep(0.7)
        zadlev=GPIO.PWM(15,50)
        zadlev.start(6)
        zadlev.ChangeDutyCicle(2)
        time.sleep(0.7)
        preddes=GPIO.PWM(7,50)
        preddes.start(6)
        preddes,ChangeDutyCicle(2)
        time.sleep(0.7)
        pdd=GPIO.PWM(22,50)
        pdd.start(12)
        pdd.ChangeDutyCicle(6)
        time.sleep(0.7)
        zddl=GPIO.PWM(38,50)
        zddl.start(7)
        zddl.ChangeDutyCicle(12)
        time.sleep(0.7)
        zadlev=GPIO.PWM(15,50)
        zadlev.start(2)
        zadlev.ChangeDutyCicle(6)
        time.sleep(0.7)
        zddl=GPIO.PWM(38,50)
        zddl.start(12)
        zddl.ChangeDutyCicle(7)
        time.sleep(0.7)
        predlev=GPIO.PWM(11,50)
        predlev.start(6)
        predlev.ChangeDutyCicle(10)
        time.sleep(0.7)
        pddl=GPIO.PWM(36,50)
        pddl.start(11)
        pddl.ChangeDutyCicle(6)
        time.sleep(0.7)
        predlev=GPIO.PWM(11,50)
        predlev.start(10)
        predlev.ChangeDutyCicle(6)
        time.sleep(0.7)
        preddes=GPIO.PWM(7,50)
        preddes.start(2)
        preddes.ChangeDutyCicle(6)
        time.sleep(0.7)
        zdd=GPIO.PWM(40,50)
        zdd.start(6)
        zdd.ChangeDutyCicle(12)
        time.sleep(0.7)
        zaddes=GPIO.PWM(13,50)
        zaddes.start(4)
        zaddes.ChangeDutyCicle(12)
        time.sleep(0.7)
        zdd=GPIO.PWM(40,50)
        zdd.start(12)
        zdd.ChangeDutyCicle(6)
        time.sleep(0.7)
        zaddes=GPIO.PWM(13,50)
        zaddes.start(12)
        zaddes.ChangeDutyCicle(6)
        time.sleep(0.7)
        pddl=GPIO.PWM(36,50)
        pddl.start(6)
        pddl.ChangeDutyCicle(12)
        time.sleep(0.7)
        i+=1
    while(i%2==0):
        pdd=GPIO.PWM(22,50)
        pdd.start(6)
        pdd.ChangeDutyCicle(12)
        time.sleep(0.7)
        zadlev=GPIO.PWM(15,50)
        zadlev.start(6)
        zadlev.ChangeDutyCicle(2)
        time.sleep(0.7)
        preddes=GPIO.PWM(7,50)
        preddes.start(6)
        preddes,ChangeDutyCicle(2)
        time.sleep(0.7)
        pdd=GPIO.PWM(22,50)
        pdd.start(12)
        pdd.ChangeDutyCicle(6)
        time.sleep(0.7)
        zddl=GPIO.PWM(38,50)
        zddl.start(7)
        zddl.ChangeDutyCicle(12)
        time.sleep(0.7)
        zadlev=GPIO.PWM(15,50)
        zadlev.start(2)
        zadlev.ChangeDutyCicle(6)
        time.sleep(0.7)
        zddl=GPIO.PWM(38,50)
        zddl.start(12)
        zddl.ChangeDutyCicle(7)
        time.sleep(0.7)
        predlev=GPIO.PWM(11,50)
        predlev.start(6)
        predlev.ChangeDutyCicle(10)
        time.sleep(0.7)
        pddl=GPIO.PWM(36,50)
        pddl.start(11)
        pddl.ChangeDutyCicle(6)
        time.sleep(0.7)
        predlev=GPIO.PWM(11,50)
        predlev.start(10)
        predlev.ChangeDutyCicle(6)
        time.sleep(0.7)
        preddes=GPIO.PWM(7,50)
        preddes.start(2)
        preddes.ChangeDutyCicle(6)
        time.sleep(0.7)
        zdd=GPIO.PWM(40,50)
        zdd.start(6)
        zdd.ChangeDutyCicle(12)
        time.sleep(0.7)
        zaddes=GPIO.PWM(13,50)
        zaddes.start(4)
        zaddes.ChangeDutyCicle(12)
        time.sleep(0.7)
        zdd=GPIO.PWM(40,50)
        zdd.start(12)
        zdd.ChangeDutyCicle(6)
        time.sleep(0.7)
        zaddes=GPIO.PWM(13,50)
        zaddes.start(12)
        zaddes.ChangeDutyCicle(6)
        time.sleep(0.7)
        pddl=GPIO.PWM(36,50)
        pddl.start(6)
        pddl.ChangeDutyCicle(12)
        time.sleep(0.7)
        i+=1
GPIO.cleanup()
        
