Skip to content

crwdns342183:0crwdne342183:0

crwdns316780:0crwdne316780:0

crwdns338145:0crwdne338145:0 | MakeCode, Python | crwdns255566:0crwdne255566:0, crwdns274474:0crwdne274474:0 | crwdns258502:0crwdne258502:0, crwdns258504:0crwdne258504:0, crwdns258516:0crwdne258516:0, crwdns258540:0crwdne258540:0, crwdns293292:0crwdne293292:0

crwdns277340:0crwdne277340:0

crwdns277342:0crwdne277342:0

crwdns277344:0crwdne277344:0

crwdns277346:0crwdne277346:0

crwdns277348:0crwdne277348:0

crwdns277350:0crwdne277350:0

  • crwdns277658:0crwdne277658:0
  • crwdns277660:0crwdne277660:0
  • crwdns277662:0crwdne277662:0

crwdns277358:0crwdne277358:0

  • crwdns277360:0crwdne277360:0 crwdns277362:0crwdne277362:0 crwdns277364:0crwdne277364:0
  • crwdns277366:0crwdne277366:0 crwdns277368:0crwdne277368:0
  • crwdns277370:0crwdne277370:0
  • crwdns277372:0crwdne277372:0
  • crwdns277374:0crwdne277374:0
  • crwdns277376:0crwdne277376:0 crwdns277378:0crwdne277378:0 crwdns277380:0crwdne277380:0
  • crwdns277382:0crwdne277382:0

crwdns277384:0crwdne277384:0

  • crwdns277386:0crwdne277386:0
  • crwdns277388:0crwdne277388:0
  • crwdns277390:0crwdne277390:0

crwdns277392:0crwdne277392:0

1from microbit import *
2microphone.set_threshold(SoundEvent.LOUD, 150)
3start = 0
4
5while True:
6    if microphone.was_event(SoundEvent.LOUD):
7        start = running_time()
8        display.show(Image.TARGET)
9
10    if microphone.was_event(SoundEvent.QUIET):
11        if start > 0:
12            time = running_time() - start
13            start = 0
14            display.clear()
15            sleep(100)
16            display.scroll(time / 1000)

crwdns277394:0crwdne277394:0

  • crwdns277396:0crwdne277396:0
  • crwdns277398:0crwdne277398:0