Advertisement
Guest User

Untitled

a guest
Oct 10th, 2015
38
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. import os
  2. import time
  3. import RPi.GPIO as GPIO
  4. GPIO.setmode(GPIO.BCM)
  5. GPIO.setup(4,GPIO.IN)
  6.  
  7. prev_input = 0
  8. while True:
  9. input = GPIO.input(4)
  10. if ((not prev_input) and input):
  11. os.system("killall matchbox-keyboard iceweasel")
  12. prev_input = input
  13. #slight pause to debounce
  14. time.sleep(0.05)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement