Created
August 23, 2016 03:45
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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