Advertisement
edofhell

Python push button

Feb 12th, 2016
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. import RPi.GPIO as GPIO
  2. #import time
  3. import os
  4.  
  5. radioPin = 11
  6. antennaPin = 12
  7.  
  8. GPIO.setmode(GPIO.BCM)
  9. GPIO.setup(radioPin,GPIO.IN)
  10. GPIO.setup(antennaPin,GPIO.IN)
  11.  
  12. while True:
  13. if (GPIO.input(radioPin)):
  14. os.system("python /home/pi/bin/button/antenna.py")
  15.  
  16. if (GPIO.input(antennaPin)):
  17. os.system("python /home/pi/bin/button/radio.py")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement