Skip to content

활동

Touch heart

초급 | MakeCode | LED, 터치 로고 | 입력/출력

1단계: 만들어 보세요.

프로젝트 소개

Light up your micro:bit with a heart - but only while you touch it!

소개

프로그래밍 가이드

학습 내용

  • 신형 마이크로비트의 터치 로고 센서에 손을 터치할 때와 놓을 때 서로 다른 이벤트를 발생시켜 사용하는 방법

설명

  • This project will light up the LED display with a heart icon, but only as long as you hold your finger on the logo on the front of the new micro:bit.
  • The gold logo is a touch sensor that works a bit like a touch screen on a mobile phone, measuring tiny changes in electricity. This is also called a capacitive touch sensor, because it uses measurements of electrical capacitance to work.
  • The 'on logo touched' block is triggered when you first touch the logo.
  • The 'on logo released' block senses when you let go of the logo and the program clears the display.
  • 'On logo touched' only triggers when you first put your finger on the logo, unlike the 'on logo pressed' block used in the Touch emotion badge project, only triggering when you touch and let go of the logo, pressing it like a button.

준비물

  • new micro:bit with sound (or MakeCode simulator)
  • MakeCode 편집기
  • AAA 배터리 팩 (옵션)

2단계: 프로그래밍 해보세요.

3단계: 더 좋게 만들어 보세요.

  • Modify the program with different icons, or draw your own
  • Add sound so the micro:bit makes a noise when you touch it