Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Add your Python code here. E.g.
from microbit import *

while True:
gesture = accelerometer.current_gesture()
if gesture == "right":
display.show(Image.ARROW_E)
elif gesture == "left":
display.show(Image.ARROW_W)
else:
display.show(Image.SKULL)
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Add your Python code here. E.g.
from microbit import *
import random

answers = [
"Yes",
"No",
"I cannot answer that yet"
]

while True:
display.show("?")
if accelerometer.was_gesture("shake"):
display.clear()
sleep(1000)
display.scroll(random.choice(answers))
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Add your Python code here. E.g.
from microbit import *

while True:
readingx = accelerometer.get_x()
readingy = accelerometer.get_y()

if readingx > 20:
display.show("R")
elif readingx < -20:
display.show("L")

elif readingy > 20:
display.show("U")
elif readingy < -20:
display.show("D")

else:
display.show("-")
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Add your Python code here. E.g.
from microbit import *

import speech

speech.say("How are you?", speed=110, pitch=200, throat=100, mouth=255)

Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Add your Python code here. E.g.
from microbit import *

import random
while True:
if button_a.is_pressed():
display.show(str(random.randint(1, 6)))
sleep(2000)
else:
display.show(Image.TSHIRT)
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Add your Python code here. E.g.
from microbit import *

import random
while True:
if button_a.is_pressed():
display.show(str(random.randint(1, 26)))
sleep(2000)
else:
display.show(Image.TSHIRT)
Binary file not shown.
Binary file not shown.
Binary file not shown.