Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save uktechreviews/e9a62e9643a3566b56199083d2b75a6b to your computer and use it in GitHub Desktop.
Save uktechreviews/e9a62e9643a3566b56199083d2b75a6b to your computer and use it in GitHub Desktop.
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