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

self.newWindow.show()
                                            self.hide()


                                            userinfo_id=""
                                            userinfo_password="“


            if  login  ==  'no'  :              #no 일  경우  다시  로그인  해야함
                                            reg   =   QMessageBox.information(self,   ' 오류',   " 등록되지   않은   정보입니
            다.",QMessageBox.Yes)
                                            self.newWindow  =  loginWindow(self)
                                            self.newWindow.show()
                                            self.hide()


                                            userinfo_id=""
                                            userinfo_password="“


            -----------------------------------------------------------------------------
            def  borrow_clicked(self):
                            global  M_SW1,  M_SW2,  mt1,  mt2,  cnt1,  cnt2,  pir,  flag1,  flag2,  a,  count


                            while  1:
                                    for  i  in  a:
                                            if  GPIO.input(pir[i])  ==  True:
                                                    cnt1[i]  =  cnt1[i]  +  1
                                            else:
                                                    cnt1[i]  =  0


                                    time.sleep(0.01)
                                    count+=1


                                    if  count  ==  100:
                                            for  i  in  a:
                                                    if  cnt1[i]  >=  50:
                                                            flag1[i]  =  1
                                                    else:
                                                            flag1[i]  =  0
                                            count  =  0
                                            print(flag1[0],flag1[1],flag1[2],flag1[3])
                                            break


                            GPIO.setup(mt1,  GPIO.OUT,  initial=GPIO.HIGH)
                            GPIO.setup(mt2,  GPIO.OUT,  initial=GPIO.LOW)


                            while  1:
                                    if  GPIO.input(M_SW1)  ==  False:

                                                                                      인천전자마이스터고등학교
                                                         -  407  -                       정보통신기기과         407
   386   387   388   389   390   391   392   393   394   395   396