Skip to content

Instantly share code, notes, and snippets.

from microbit import *
from emoji import *
while True:
display.show(😃)
if accelerometer.was_gesture('shake'):
display.show(😡)
sleep(2000)
if button_a.was_pressed():
display.show(💖)
@microbit-mark
microbit-mark / emopji.py
Created November 5, 2019 09:32
Emoji module example
# microbit-module: emoji@0.1.0
# First we add a comment that this is a microbit-module and
# give it a name and version number in the format major.minor.patch eg. emoji@0.1.0
from microbit import Image
# We import the image class from the microbit module
😃 = Image.HAPPY
😡 = Image.ANGRY
💖 = Image.HEART
/*
The MIT License (MIT)
Copyright (c) 2016 British Broadcasting Corporation.
This software is provided by Lancaster University by arrangement with the BBC.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,