Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def normal(ev=None):
- global row_countn,f,dbauto,normalCounter
- global Led_status,flag2,flag3
- while (True):
- if(GPIO.input(BtnPin)==GPIO.LOW and GPIO.input(normalBtn)==GPIO.LOW):
- normalCounter+=1
- print ("Machine is on And normal stop button pressed "+str(normalCounter))
- now=datetime.datetime.now()
- row_countn=row_countn+1
- sheetn.cell(row=row_countn, column=1).value =str(now.hour)+":"+str(now.minute)+":"+str(now.second)
- sheetn.cell(row=row_countn, column=2).value = str(datetime.datetime.now().date());
- wbn.save(filepathn)
- os.system('python3.7 ExceltoMysqlNormal.py')
- break
- elif(GPIO.input(BtnPin)==GPIO.HIGH and GPIO.input(normalBtn)==GPIO.LOW):
- print ("Main inside Pin "+str(GPIO.input(BtnPin))+" Normal inside Pin "+str(GPIO.input(normalBtn)))
- print ("Machine is OFF And normal stop button pressed")
- break
- else:
- print ("Main Pin "+str(GPIO.input(BtnPin))+" Normal Pin "+str(GPIO.input(normalBtn)))
- flag3=0
- break
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement