Advertisement
Guest User

Untitled

a guest
Oct 25th, 2017
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. import import RPi.GPIO as GPIO
  2. from tkinter import *
  3. import socket
  4. import sys
  5. import time
  6.  
  7. def alarmstopped()
  8. return True
  9.  
  10. count = 0
  11.  
  12. while True:
  13. if buttonPressed() == True: #Button pressed
  14. while True:
  15. if alarmStoped() == True: #Stops 30sec count
  16. break
  17. count = 0
  18. elif count >=30:
  19. sendTCP() #Sends TCP to other RPI
  20. time.sleep(0.2)
  21. break
  22. else:
  23. count += 1
  24. time.sleep(1)
  25. print(count)
  26. continue
  27. else:
  28. continue
  29.  
  30. root = Tk()
  31. button = Button(master=root, cursor='hand2', text='stop alarm', command=alarmStoped)
  32. button.pack()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement