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
import radio | |
from microbit import button_a, display, Image | |
radio.on() | |
display.show(Image.HAPPY) | |
while True: | |
if button_a.was_pressed(): | |
radio.send('go') |
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
import speech | |
import radio | |
from microbit import display, Image | |
phrases = [ | |
"#31froyderr " # Freude | |
"#29sherr#26ner " # schoner | |
"gerr#29terr#31fuhnx#35kahn" # Gotterfunken | |
"#39taaaakterr " # Tochter |
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
import speech | |
import radio | |
from microbit import display, Image | |
phrases = [ | |
"#39froyderr " # Freude | |
"#35sherr#31ner " # schoner | |
"gerr#35terr#39fuhnx#52kahn" # Gotterfunken | |
"#62taaaakterr " # Tochter |
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 accelerometer, display, Image, sleep | |
import random | |
pictures = [ | |
Image('55555:55555:55555:55555:55555'), # Rock | |
Image('50005:05050:00500:55055:55055'), # Scissors | |
Image('55500:50050:50005:50005:55555'), # Paper | |
] | |
while True: |
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 * | |
import radio | |
radio.on() | |
while True: | |
msg = radio.receive_bytes() | |
if msg: | |
uart.write(msg[3:]) |
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
""" | |
Listen to a connected micro:bit for incoming messages to which you can react | |
as needs apply. | |
""" | |
from serial.tools.list_ports import comports as list_serial_ports | |
from serial import Serial | |
def find_microbit(): | |
""" |
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
import nativeio | |
import time | |
from board import SPEAKER | |
notes = { | |
'b': 26, | |
'a#': 27, | |
'a': 28, | |
'g#': 29, |
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 * | |
radio.on() | |
while True: | |
if radio.receive(): | |
display.show(image.DUCK) | |
if accelerometer.was_gesture('shake'): | |
radio.send('duck') | |
sleep(20) |
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
import time | |
print('start') | |
for i in range(10): | |
print(i) | |
time.sleep(1) | |
print('stop') |
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
""" | |
Attack of the Killer-Cave Plotter from the Planet Raxxla! | |
by Nicholas H.Tollervey. Released into the public domain. | |
Instructions: | |
Open Mu, put it into Adafruit mode and switch on the REPL | |
and plotter. |