Skip to content

Instantly share code, notes, and snippets.

@WayneKeenan
Created September 19, 2018 11:48
Show Gist options
  • Save WayneKeenan/87ebc696b7d564170739fdd07300c850 to your computer and use it in GitHub Desktop.
Save WayneKeenan/87ebc696b7d564170739fdd07300c850 to your computer and use it in GitHub Desktop.
gpiozero buttons on the microbit
from gpiozero import Button
def buttonA_pressed():
print("Button A")
def buttonB_pressed():
print("Button B")
buttonA = Button(13)
buttonA.when_pressed(buttonA_pressed)
buttonB = Button(14)
buttonB.when_pressed(buttonB_pressed)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment