Skip to content

Instantly share code, notes, and snippets.

@ShawnHymel
Created August 23, 2016 03:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ShawnHymel/689a6c59938dffeac0e9d42d7cd1d40a to your computer and use it in GitHub Desktop.
Save ShawnHymel/689a6c59938dffeac0e9d42d7cd1d40a to your computer and use it in GitHub Desktop.
Have the micro:bit show a happy face when A is pressed, a sad face when B is pressed, and a meh face when no buttons are pressed.
from microbit import *
while True:
if button_a.is_pressed():
display.show(Image.HAPPY)
elif button_b.is_pressed():
display.show(Image.SAD)
else:
display.show(Image.MEH)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment