Skip to content

Instantly share code, notes, and snippets.

@uktechreviews
Created August 9, 2017 07:19
Show Gist options
  • Save uktechreviews/e45bc9288c592d3ff4a8164700ac5441 to your computer and use it in GitHub Desktop.
Save uktechreviews/e45bc9288c592d3ff4a8164700ac5441 to your computer and use it in GitHub Desktop.
GPIO Two button
from gpiozero import Button
button1 = Button(2)
button2 = Button(3)
def check_button():
button_press = False
while button_press == False:
b1 = button1.value
b2 = button2.value
if b1 == True:
button_press = True
if b2 == True:
button_press = True
return b1,b2
b1,b2 = check_button()
print (b1)
print (b2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment