Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import import RPi.GPIO as GPIO
- from tkinter import *
- import socket
- import sys
- import time
- def alarmstopped()
- return True
- count = 0
- while True:
- if buttonPressed() == True: #Button pressed
- while True:
- if alarmStoped() == True: #Stops 30sec count
- break
- count = 0
- elif count >=30:
- sendTCP() #Sends TCP to other RPI
- time.sleep(0.2)
- break
- else:
- count += 1
- time.sleep(1)
- print(count)
- continue
- else:
- continue
- root = Tk()
- button = Button(master=root, cursor='hand2', text='stop alarm', command=alarmStoped)
- button.pack()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement