소스 코드 예시
from microbit import *
while True:
sound_level = microphone.sound_level()
brightness = min(sound_level // 28, 9)
for x in range(5):
for y in range(5):
display.set_pixel(x, y, brightness)
sleep(100)
소스 코드 예시
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)
댓글 없음:
댓글 쓰기