Page 16 - MDP2020-3
P. 16

10
                      |    인천전자마이스터고등학교  ·············································································································



            try:

                    while  RUNNING:
                            RED.start(1)
                            GREEN.start(100)
                            BLUE.start(1)
                            for  x  in  range(1,101):

                                    BLUE.ChangeDutyCycle(x)
                                    time.sleep(0.1)
                            if(x<=100):
                                    GREEN.RUNNING=True
                            for  x  in  range(1,101):

                                    GREEN.ChangeDutyCycle(101-x)
                                    time.sleep(0.5)
                            for  x  in  range(1,101):
                                    BLUE.ChangeDutyCycle(101-x)
                                    RED.ChangeDutyCycle(x)

                                    time.sleep(0.5)
                    else  if(a<=150):
                                    BLUE.RUNNING=True
                            for  x  in  range(1,101):
                                    GREEN.ChangeDutyCycle(x)

                                    time.sleep(0.5)
                    else  if(a<=200):
                                    RED.RUNNING=True
            except  KeyboardInterrupt:
                    RUNNING=False

                    GPIO.cleanup()
   11   12   13   14   15   16   17   18   19   20   21