Skip to content

crwdns342183:0crwdne342183:0

crwdns312454:0crwdne312454:0

crwdns338145:0crwdne338145:0 | MakeCode, Python | crwdns255558:0crwdne255558:0, crwdns255570:0crwdne255570:0 | crwdns258498:0crwdne258498:0, crwdns258504:0crwdne258504:0, crwdns258554:0crwdne258554:0

crwdns257690:0crwdne257690:0

crwdns257692:0crwdne257692:0

crwdns257694:0crwdne257694:0

crwdns257696:0crwdne257696:0

crwdns257698:0crwdne257698:0

  • crwdns257700:0crwdne257700:0 crwdns257702:0crwdne257702:0
  • crwdns257704:0crwdne257704:0 crwdns257706:0crwdne257706:0
  • crwdns257708:0crwdne257708:0
  • crwdns257710:0crwdne257710:0
  • crwdns257712:0crwdne257712:0
  • crwdns257714:0crwdne257714:0
  • crwdns257716:0crwdne257716:0

crwdns257718:0crwdne257718:0

  • crwdns257720:0crwdne257720:0
  • crwdns257722:0crwdne257722:0
  • crwdns257724:0crwdne257724:0
  • crwdns257726:0crwdne257726:0

crwdns257728:0crwdne257728:0

1from microbit import *
2import radio
3radio.config(group=7)
4radio.on()
5
6while True:
7    message = radio.receive()
8    if message:
9        if message == 'yes':
10            display.show(Image.YES)
11            sleep(500)
12            display.clear()
13        elif message == 'no':
14            display.show(Image.NO)
15            sleep(500)
16            display.clear()
17    if button_a.was_pressed():
18        radio.send('yes')
19        display.show(Image.YES)
20        sleep(500)
21        display.clear()
22    if button_b.was_pressed():
23        radio.send('no')
24        display.show(Image.NO)
25        sleep(500)
26        display.clear()
27

crwdns257730:0crwdne257730:0

  • crwdns257732:0crwdne257732:0
  • crwdns257734:0crwdne257734:0
  • crwdns257736:0crwdne257736:0