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
This content is published under a Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) licence.