Skip to content

crwdns342183:0crwdne342183:0

crwdns312432:0crwdne312432:0

crwdns338145:0crwdne338145:0 | MakeCode, Python | crwdns255566:0crwdne255566:0, crwdns274474:0crwdne274474:0 | crwdns258490:0crwdne258490:0, crwdns258516:0crwdne258516:0, crwdns258540:0crwdne258540:0, crwdns258616:0crwdne258616:0

crwdns274828:0crwdne274828:0

crwdns274830:0crwdne274830:0

crwdns274832:0crwdne274832:0

crwdns274834:0crwdne274834:0

crwdns274836:0crwdne274836:0

crwdns274838:0crwdne274838:0

  • crwdns274840:0crwdne274840:0
  • crwdns274842:0crwdne274842:0

crwdns274844:0crwdne274844:0

  • crwdns274846:0crwdne274846:0
  • crwdns274848:0crwdne274848:0 crwdns274850:0crwdne274850:0
  • crwdns274852:0crwdne274852:0 crwdns274854:0crwdne274854:0
  • crwdns274856:0crwdne274856:0

crwdns274858:0crwdne274858:0

  • crwdns274860:0crwdne274860:0
  • crwdns274862:0crwdne274862:0
  • crwdns274864:0crwdne274864:0

crwdns274866:0crwdne274866:0

1from microbit import *
2maxSound = 0
3lights = Image("11111:"
4              "11111:"
5              "11111:"
6              "11111:"
7              "11111")
8# ignore first sound level reading
9soundLevel = microphone.sound_level()
10sleep(200)
11
12while True:
13    if button_a.is_pressed():
14        display.scroll(maxSound)
15    else:
16        soundLevel = microphone.sound_level()
17        display.show(lights * soundLevel)
18        if soundLevel > maxSound:
19            maxSound = soundLevel
20            

crwdns274868:0crwdne274868:0

  • crwdns274870:0crwdne274870:0
  • crwdns274872:0crwdne274872:0