Skip to content

crwdns342183:0crwdne342183:0

crwdns342117:0crwdne342117:0

crwdns347529:0crwdne347529:0 | MakeCode, Python | crwdns255558:0crwdne255558:0, crwdns255566:0crwdne255566:0, crwdns255568:0crwdne255568:0 | crwdns258498:0crwdne258498:0, crwdns258502:0crwdne258502:0, crwdns258504:0crwdne258504:0, crwdns258538:0crwdne258538:0, crwdns258544:0crwdne258544:0, crwdns258554:0crwdne258554:0

crwdns342123:0crwdne342123:0

crwdns342125:0crwdne342125:0

crwdns342127:0crwdne342127:0

crwdns342133:0crwdne342133:0

  • crwdns342135:0crwdne342135:0 crwdns342137:0crwdne342137:0
  • crwdns342139:0crwdne342139:0
  • crwdns342141:0crwdne342141:0
  • crwdns342143:0crwdne342143:0 crwdns342145:0crwdne342145:0 crwdns342147:0crwdne342147:0

crwdns342149:0crwdne342149:0

  • crwdns342151:0crwdne342151:0
  • crwdns342153:0crwdne342153:0 crwdns342155:0crwdne342155:0
  • crwdns342157:0crwdne342157:0 crwdns342159:0crwdne342159:0

crwdns342161:0crwdne342161:0

  • crwdns342163:0crwdne342163:0
  • crwdns342165:0crwdne342165:0
  • crwdns342167:0crwdne342167:0
  • crwdns342169:0crwdne342169:0

crwdns342171:0crwdne342171:0

crwdns342173:0crwdne342173:0

1from microbit import *
2import radio
3radio.config(group=17)
4radio.on()
5
6while True:
7    if button_a.was_pressed():
8        display.scroll(compass.get_field_strength())
9    if compass.get_field_strength() < 100000:
10        display.show(Image.DIAMOND_SMALL)
11        radio.send('open')
12    else:
13        display.clear()
14        radio.send('closed')
15    sleep(2000)
16

crwdns342175:0crwdne342175:0

1from microbit import *
2import music
3import radio
4radio.config(group=17)
5radio.on()
6
7while True:
8    message = radio.receive()
9    if message:
10        if message == 'open':
11            display.show(Image.NO)
12            music.play(["C4:4"])
13        if message == 'closed':
14            display.show(Image.YES)
15

crwdns342177:0crwdne342177:0

  • crwdns342179:0crwdne342179:0
  • crwdns342181:0crwdne342181:0