Created
April 28, 2016 14:50
-
-
Save mavhc/2c2d43bc3c877bef93847db3b71f63d9 to your computer and use it in GitHub Desktop.
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
# See https://www.youtube.com/watch?v=L8egrL-WC-0 | |
import microbit | |
def pick_speed(speed): | |
while not microbit.button_b.is_pressed(): | |
microbit.display.show(str(speed)) | |
if microbit.button_a.is_pressed(): | |
speed -= 1 | |
if speed < 1: speed = 9 | |
microbit.sleep(200) | |
return speed | |
t = "Welcome to the multi micro:bit demo" | |
print("Start") | |
delay = pick_speed(0) | |
microbit.display.show(microbit.Image.ANGRY) | |
x = microbit.accelerometer.get_x() | |
print(x) | |
while x < 500 and x > -500: | |
x = microbit.accelerometer.get_x() | |
print(x) | |
microbit.display.clear() | |
microbit.sleep(delay*700) | |
while True: | |
microbit.display.scroll(t) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment