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

#  measure  PM2.5
                           s25.measureStart()
                           time.sleep(30)
                           s25.measureStop()


                           timestamp  =  datetime.now()
                           g25,  interval25,  r25,  PM25count,  total_interrupt_count25,  wrong_level_count25
             =  s25.read()


                           if  PM25count  <  0  or  PM25count  ==  1114000.62:
                                   PM25count  =  0


                           print("PM2.5  time:  {},  Interval:  {},  Ratio:  {:.3f},  Count:  {},  Total  Interrupt:  {},
             Wrong  Interrupt:  {}".
                                   format(timestamp,       int(interval25),     r25,       int(PM25count),
             total_interrupt_count25,  wrong_level_count25))
                           print("--")


                    pi.stop()  #  Disconnect  from  Pi.



              o  데이터베이스  읽기  및  쓰기

















































                                                         -  318  -
   301   302   303   304   305   306   307   308   309   310   311