서버 점검 안내

dsclub은 서비스의 안정성과 성능 향상을 위해
매일 04시 30분에 정기 점검이 진행됩니다.

점검 시간: 오전 4시 30분 ~ 4시 35분

해당 시간 동안 일시적으로 서비스에 접속이 불가능하오니, 양해 부탁드립니다.

tak2저격글 > 코딩 스토리

tak2저격글

페이지 정보

작성자 tak2저격 (211.♡.168.221) 작성일 24-10-18 10:23 조회 56 댓글 0

본문

from microbit import *
import audio

led_image = Image("11111:11111:11111:11111:11111")
touch_image = Image("00000:09090:00000:90009:09990")
shake_image = Image("99099:99099:00900:09090:00900")
timer=0
audio.play(Sound.HELLO)

while True:
    display.show(led_image * ((microphone.sound_level()/255) * 9) )
    if pin_logo.is_touched():
        timer = 0
        display.show(touch_image)
        audio.play(Sound.HAPPY)
    elif accelerometer.was_gesture('shake'):
        timer = 0
        display.show(shake_image)
        audio.play(Sound.GIGGLE)
    else:
        sleep(1000)
        timer = timer + 1
    if  timer > 60 :
        display.show(Image.ASLEEP)
        audio.play(Sound.YAWN)
    elif timer > 120 :
        display.show(Image.CONFUSED)
        audio.play(Sound.SAD)
    elif timer > 180 :
        display.show(Image.ANGRY)
        audio.play(Sound.MYSTERIOUS)
좋아요0 이 글을 좋아요하셨습니다
url 복사 카카오톡 공유 라인 공유 페이스북 공유 트위터 공유

등록된 댓글이 없습니다.

전체 270건
게시물 검색

접속자집계

오늘
830
어제
779
최대
4,271
전체
290,295