Advertisement
Guest User

Untitled

a guest
Aug 20th, 2019
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.13 KB | None | 0 0
  1. def normal(ev=None):
  2. global row_countn,f,dbauto,normalCounter
  3. global Led_status,flag2,flag3
  4. while (True):
  5. if(GPIO.input(BtnPin)==GPIO.LOW and GPIO.input(normalBtn)==GPIO.LOW):
  6. normalCounter+=1
  7. print ("Machine is on And normal stop button pressed "+str(normalCounter))
  8. now=datetime.datetime.now()
  9. row_countn=row_countn+1
  10. sheetn.cell(row=row_countn, column=1).value =str(now.hour)+":"+str(now.minute)+":"+str(now.second)
  11. sheetn.cell(row=row_countn, column=2).value = str(datetime.datetime.now().date());
  12. wbn.save(filepathn)
  13. os.system('python3.7 ExceltoMysqlNormal.py')
  14. break
  15.  
  16. elif(GPIO.input(BtnPin)==GPIO.HIGH and GPIO.input(normalBtn)==GPIO.LOW):
  17. print ("Main inside Pin "+str(GPIO.input(BtnPin))+" Normal inside Pin "+str(GPIO.input(normalBtn)))
  18. print ("Machine is OFF And normal stop button pressed")
  19. break
  20. else:
  21. print ("Main Pin "+str(GPIO.input(BtnPin))+" Normal Pin "+str(GPIO.input(normalBtn)))
  22. flag3=0
  23. break
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement