Advertisement
edofhell

Untitled

Feb 19th, 2016
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. ##### PIN DEFINE
  2. radiobutton = 10
  3. radiorelay = 4
  4. antennabutton = 13
  5. antennerelay = 5
  6.  
  7. ##### GPIO SETUP/SETMODE
  8. GPIO.setmode(GPIO.BCM)
  9. GPIO.setup(radiobutton,GPIO.IN)
  10. GPIO.setup(antennabutton,GPIO.IN)
  11. GPIO.setup(radiorelay,GPIO.OUT)
  12. GPIO.setup(antennerelay,GPIO.OUT)
  13.  
  14. ##### While true
  15. while True:
  16.  
  17. if (GPIO.input(radiobutton)):
  18. ledState = False
  19. ledState = not ledState
  20. GPIO.output(radiorelay, not GPIO.input(radiorelay))
  21.  
  22. if (GPIO.input(antennabutton)):
  23. ledState = False
  24. ledState = not ledState
  25. GPIO.output(antennerelay, not GPIO.input(antennerelay))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement