Page 15 - MDP2020-3
P. 15

················································································  명장양성프로젝트  【MDP】  과제발표회  자료집  Ⅲ    |  9


            8.  소프트웨어  작성하기

                가.  프로그램  흐름도



































            나.  온습도  측정을  하기  위한  프로그램  소스



            import  Rpi.GPIO  as  GPIO
            import  time


            GPIO.setmode(GPIO.BCM)



            RUNNING  =  True


            green=27
            red=17

            blue=22


            GPIO.setup(red,  GPIO.OUT)
            GPIO.setup(green,  GPIO.OUT)
            GPIO.setup(blue,  GPIO.OUT)



            Freg=  100


            RED=GPIO.PWM(red,Freg)
            GREEN=GPIO.PWM(green,Freg)

            BLUE=GPIO.PWM(blue,Freg)
   10   11   12   13   14   15   16   17   18   19   20