ステップ1: 作る
説明
ボタンを押すだけで、色々な曲を流す音響機器を作ってみましょう。
この2つのビデオで、何を作り、どのようにコーディングするかご案内します。
はじめに
プログラミングガイド
動作の仕組み
- ジュークボックスはコインを入れてボタンを押し、聞きたい曲を選択して色々な曲を聞くことができる機器です。
- This micro:bit jukebox uses the A and B button inputs to play different built-in tunes.
- If you have a micro:bit V2 with built-in speaker, you'll hear the sound straight away. You can also attach headphones to any micro:bit using crocodile clip leads:
- micro:bitのP0端子をヘッドフォンプラグの先端に、GND端子をヘッドフォンプラグの長い部分に接続します。
- micro:bitを使って音を鳴らす時、P0端子が出力になります。
必要なもの
- micro:bit(またはMakeCodeシミュレーター)
- MakeCodeまたはPythonエディター
- バッテリーパック(オプション)
- a pair of headphones and two crocodile clip leads (optional)
ステップ2: プログラムする
ステップ3: 改善する
- 曲を「プレリュード」や「ジ・エンターテイナー」に変更してみましょう。 You can find a list of all the built-in tunes you can use in Python here.
- 選択した曲によって異なるマーク、文字、数字や単語を表示してみましょう。
- Make it play a different tune if you shake it, press buttons A and B at the same time, or press the micro:bit's touch logo.
This content is published under a Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) licence.