2024.09.20 센텀고 정보 소음 감지기 > 코딩 스토리

2024.09.20 센텀고 정보 소음 감지기

본문

[code]

# Imports go at the top
from microbit import *
led_image1 = Image("11111:11111:11111:11111:11111")
led_image2 = Image("55555:55555:55555:55555:55555")
led_image3 = Image("99999:99999:99999:99999:99999")

while True:
    sound_level = microphone.sound_level()
    if sound_level < 50:
        display.show(led_image1)
    if 150 > sound_level > 100:
        display.show(led_image2)
    if sound_level > 150:
        display.show(led_image3)

[/code]

 

[code]

# Imports go at the top
from microbit import *
led_image1 = Image("11111:11111:11111:11111:11111")
led_image2 = Image("55555:55555:55555:55555:55555")
led_image3 = Image("99999:99999:99999:99999:99999")

while True:
    sound_level = microphone.sound_level()
    if sound_level < 86:
        display.show(led_image1)
    elif 86 < sound_level > 170:
        display.show(led_image2)

[/code]

 

#마이크로비트 #파이썬

좋아요55 이 글을 좋아요하셨습니다
url 복사 카카오톡 공유 라인 공유 페이스북 공유 트위터 공유
지역-로컬
Powered by AI

등록된 댓글이 없습니다.

  • RSS
  • _  글쓰기 글쓰기
전체 87건
게시물 검색

접속자집계

오늘
2,948
어제
4,635
최대
42,418
전체
1,133,477