0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

micro:bitプログラムサンプル:連打力測定マシン 初号機

Last updated at Posted at 2025-10-02

micro:bitと押しボタンで連打力を測定するマシンのプログラムサンプル

プログラム概要

  • 電源が入ると最初のゲーム=カウントダウンが自動的にスタート
  • 押しボタンが押されているかどうかの情報はmicro:bit上の端子P0から入力します。
    ※押されている場合はP0=0、押されていない場合はP0=1となる
  • 5秒が経過(変数Starttime-稼働時間 が5000ミリ秒以上になる)したらゲームは終了(変数OnGame=0に変更)し、スコア(変数score)を表示するループに入る
  • micro:bit上のAボタンが押されると全体がリセットされてカウントダウンがスタート

プログラムサンプル

microbit-画面コピー (4).png

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?