Page 309 - 2020학년도 MDP과제발표회 자료집 (통신과) (3)
P. 309

if  flagForEvent  ==  0:
                             if  hyper:
                                     print("off  screen")


                                     removing()
                                     window.config(bg="black")
                                     flagForScreen  =  1


                             else:
                                     print("on  screen")
                                     flagForScreen  =  0


                                     removing()
                                     coloring()
                                     griding()




             def  gas_detect():
                     global  flagForGas
                     global  activate
                     global  perc


                     if  perc["CO"]  >  1:
                             ref.update({'gas':  '1'})
                             activate  =  1
                             time.sleep(5)
                             print("\n  gas  set  \n")
                             flagForGas  =  1


                     elif  flagForGas  ==  1:
                             activate  =  0
                             ref.update({'gas':  '0'})
                             print("\n  gas  clear  \n")
                             flagForGas  =  0


                     sys.stdout.flush()




             def  fire_detect():
                     global  flagForFire
                     global  sensor
                     global  activate


                     humidity,  temperature  =  Adafruit_DHT.read_retry(sensor,  pin)


                     if  humidity  is  not  None  and  temperature  is  not  None:
                                                         -  321  -
   304   305   306   307   308   309   310   311   312   313   314