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]

 

#마이크로비트 #파이썬

좋아요51 이 글을 좋아요하셨습니다
url 복사 카카오톡 공유 라인 공유 페이스북 공유 트위터 공유

카테고리 분류 학습 시스템 (총 0개 학습됨)

예측 카테고리: 생활-라이프 (랜덤 - 학습 데이터 없음)

이 분류가 맞나요? 학습시켜주세요!

등록된 댓글이 없습니다.

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

접속자집계

오늘
1,678
어제
3,897
최대
42,418
전체
939,906