from microbit import *
threshold = 100
while True:
sound_level = microphone.sound_level()
if sound_level > threshold:
display.show(Image.HAPPY)
else:
display.clear()
sleep(500)
Copyright ⓒ TECH79 All right reserved