Advertisement
Guest User

Untitled

a guest
May 4th, 2016
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. def pressed(channel):
  2. press = 1
  3. times = time.time()
  4. io.add_event_detect(pin, io.RISING, callback = released, bouncetime = 200)
  5. if time.time() - times = 3:
  6. print "You have held the button for 3 seconds"
  7. elif time.time() - times = 5
  8. print "You have held the button for 5 seconds"
  9. elif time.time() - timed = 6:
  10. print "You can let go now"
  11.  
  12. File "shutdown.py", line 43
  13. while press == 1:
  14. ^
  15. SyntaxError: invalid syntax
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement