2024.09.20 센텀고 정보 수업 줄넘기 점프 카운트
본문
[code]
# Imports go at the top
from microbit import *
import audio
jump_cnt = 0
while True:
if accelerometer.is_gesture('shake'):
jump_cnt = jump_cnt + 1
display.show(jump_cnt)
if pin_logo.is_touched():
jump_cnt = 0
audio.play(Sound.HAPPY)
[/code]
1. 흔들면 디스플레이의 숫자가 카운트된다
2. 돼지코 모양을 터치하면 소리와 함께 초기화된다
#마이크로비트 #파이썬
좋아요42
이 글을 좋아요하셨습니다
카테고리 분류 학습 시스템 (총 0개 학습됨)
예측 카테고리:
인문-철학
(랜덤 - 학습 데이터 없음)
이 분류가 맞나요? 학습시켜주세요!
등록된 댓글이 없습니다.