Advertisement
Guest User

Untitled

a guest
Nov 22nd, 2013
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. import RPi.GPIO as gpio
  2. import time
  3. import os
  4.  
  5. #adjust for where your switch is connected
  6. buttonPin = 17
  7. gpio.setmode(gpio.BCM)
  8. gpio.setup(17, gpio.IN)
  9.  
  10. while True:
  11. input_value = gpio.input(17)
  12. if input_value == False:
  13. print('The button pressed')
  14. while input_value == False:
  15. input_value = gpio.input(17)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement