Skip to content

Instantly share code, notes, and snippets.

@andreagrandi
Created December 14, 2016 21:58
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 andreagrandi/a41e7ba709b575f54ce2b9619cc46d43 to your computer and use it in GitHub Desktop.
Save andreagrandi/a41e7ba709b575f54ce2b9619cc46d43 to your computer and use it in GitHub Desktop.
Microbit Christmas Tree
from microbit import *
image_1 = Image.XMAS
image_2 = Image.HAPPY
status = 'OFF'
while True:
if button_a.is_pressed():
status = 'ON'
elif button_b.is_pressed():
status = 'OFF'
sleep(100)
if status == 'ON':
display.show(image_1)
sleep(2000)
display.show(image_2)
sleep(1000)
else:
display.clear()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment