[No.6]出力パーツを足してみよう〜音の出る「オカエリ」装置
![](https://s3.ap-northeast-1.amazonaws.com/spaceblock.jp-storage/inquiries/2024-03-26/Fz-RV6mcHJbPNFiUNeFNG.png?AWSAccessKeyId=ASIAZZVIWFLRYPYCASPF&Expires=1725770654&Signature=fuT8e3CEZ1kHS0w%2BJXBaMTqDc74%3D&x-amz-security-token=IQoJb3JpZ2luX2VjEBIaDmFwLW5vcnRoZWFzdC0xIkgwRgIhAMKKk4aPUJn0e3SMDa3%2FAteardhsO4C2QmZ%2FkpDJXcREAiEA5h1%2BhXMSAVKKhjvcAZ3JU%2FoECFek1D9LtUesx0G6ZkcqlAMIOxABGgw2NzM1ODk4OTc5NTUiDLP6gTNK2iBRQ0QEgCrxAre5ARThtFYiP5HewoKJlDsZ%2Fym9MJOratwTQ9mb3bhJubMItXViaFiSPI8BowsTLnGCxorQFqzSDW9PG05Z4D1jSUBH9Mhn0XE3SM%2BH66V86Tnci%2BdakfPPKnmEzbccndH80Z6m4jfOFQKHWXUuWNb0lBa6WFR9MmesdFj88%2FRRBgooF8chJBXQ9uBZgq%2FAuaY%2Bbyly3iIlMWXpgXUQy1tLuD5Sq7HEF8%2FB5ziU40hTprO%2B2jFPcRPNIhJEFNy%2BJpj%2Fq9ftmp2wYSuTwDF30wnZdZsiVW1pxwjadXMPUEecpeKukqEhtKcyl1IOIlojPFJphRJZZ%2BY0vgBgKhD%2BJZiKG3Kx9FSKT9Dz1sYdfWMQElc6yFFOnZ6R5hpdSHVWxLLdEW8d8S85H5xlSb26Q0JiCNupA4u9jENLdP%2BS02ry0q19vEzYrD%2B%2Fmo6gjXXZa6U66dUlVLSmhl0ZV%2FD17G4DrbZyTZIPv8okvFZpqYvvUTCpivS2BjqcATPuLjpWxhuwUWl1HwkKq2WH3PK4sfLQGRY%2Fmc8xZ0IzU6IDaMosEV%2B4LFr33F1IadIBT9rZVJZ2BBeI6vAQnKMWSeEnjHIXZANw8%2Fk0Kw7DNj46HKVTWfWkDGwH5a3MvBjxo18yawLeYwNSfetGVpS6TMMz8BArcKp7OTbcaLeyXC4Qr%2F0Hoevcuipf9syVdc74eLpb6gIDf9r4Qg%3D%3D)
小さなものづくりコンピューター「SPACEBLOCK(スペースブロック)」は、いろいろなパーツを足して自分でさまざまな機能を作ることができます。今回は出力パーツをひとつ足して、音が出る装置を作ってみましょう。[SPACEBLOCK-5]で作った「オカエリ」が表示される装置をアレンジします。
SPACEBLOCKには外部パーツがたくさん!
![](https://s3.ap-northeast-1.amazonaws.com/spaceblock.jp-storage/inquiries/2024-03-26/5fzpFETO3e9tV9CDVhmKV.png?AWSAccessKeyId=ASIAZZVIWFLRYPYCASPF&Expires=1725770654&Signature=xcDuOrr6VE1aSUYYL4G008qtwhY%3D&x-amz-security-token=IQoJb3JpZ2luX2VjEBIaDmFwLW5vcnRoZWFzdC0xIkgwRgIhAMKKk4aPUJn0e3SMDa3%2FAteardhsO4C2QmZ%2FkpDJXcREAiEA5h1%2BhXMSAVKKhjvcAZ3JU%2FoECFek1D9LtUesx0G6ZkcqlAMIOxABGgw2NzM1ODk4OTc5NTUiDLP6gTNK2iBRQ0QEgCrxAre5ARThtFYiP5HewoKJlDsZ%2Fym9MJOratwTQ9mb3bhJubMItXViaFiSPI8BowsTLnGCxorQFqzSDW9PG05Z4D1jSUBH9Mhn0XE3SM%2BH66V86Tnci%2BdakfPPKnmEzbccndH80Z6m4jfOFQKHWXUuWNb0lBa6WFR9MmesdFj88%2FRRBgooF8chJBXQ9uBZgq%2FAuaY%2Bbyly3iIlMWXpgXUQy1tLuD5Sq7HEF8%2FB5ziU40hTprO%2B2jFPcRPNIhJEFNy%2BJpj%2Fq9ftmp2wYSuTwDF30wnZdZsiVW1pxwjadXMPUEecpeKukqEhtKcyl1IOIlojPFJphRJZZ%2BY0vgBgKhD%2BJZiKG3Kx9FSKT9Dz1sYdfWMQElc6yFFOnZ6R5hpdSHVWxLLdEW8d8S85H5xlSb26Q0JiCNupA4u9jENLdP%2BS02ry0q19vEzYrD%2B%2Fmo6gjXXZa6U66dUlVLSmhl0ZV%2FD17G4DrbZyTZIPv8okvFZpqYvvUTCpivS2BjqcATPuLjpWxhuwUWl1HwkKq2WH3PK4sfLQGRY%2Fmc8xZ0IzU6IDaMosEV%2B4LFr33F1IadIBT9rZVJZ2BBeI6vAQnKMWSeEnjHIXZANw8%2Fk0Kw7DNj46HKVTWfWkDGwH5a3MvBjxo18yawLeYwNSfetGVpS6TMMz8BArcKp7OTbcaLeyXC4Qr%2F0Hoevcuipf9syVdc74eLpb6gIDf9r4Qg%3D%3D)
様々な入出力機器として使えるパーツが用意されていて、ワクワク感が増します。例えば、 入力として「明るさセンサモジュール」を使い、明るさに応じて機能する装置を作ったり、出力として「180°マイクロサーボモーター」を使い、何かが回転する装置を作ったりすることができますよ。
SPACBLOCK本体と拡張パーツはSPACEBLOCKサイトより購入できますのでチェックしてみてくださいね。今回は、これらの中からすでに販売がスタートしている「8×8 RGB LEDマトリックスパネル」(LEDパネル)と「圧電スピーカー」を使用します
必要なもの&準備
- SPACEBLOCK通常パッケージ[SPACEBLOCK本体、USBケーブル、電池ボックス]
- 8×8 RGB LEDマトリックスパネル(LEDパネル)
- 圧電スピーカー
- ジャンパーワイヤ[ピンヘッダ-ピンソケット3本]
- プログラミングをするパソコン
![](https://s3.ap-northeast-1.amazonaws.com/spaceblock.jp-storage/inquiries/2024-03-26/odNFScmqxjpOnvYDmocc0.png?AWSAccessKeyId=ASIAZZVIWFLRYPYCASPF&Expires=1725770654&Signature=2EuAa8Xak%2B9HR83klLBHsKWz1mc%3D&x-amz-security-token=IQoJb3JpZ2luX2VjEBIaDmFwLW5vcnRoZWFzdC0xIkgwRgIhAMKKk4aPUJn0e3SMDa3%2FAteardhsO4C2QmZ%2FkpDJXcREAiEA5h1%2BhXMSAVKKhjvcAZ3JU%2FoECFek1D9LtUesx0G6ZkcqlAMIOxABGgw2NzM1ODk4OTc5NTUiDLP6gTNK2iBRQ0QEgCrxAre5ARThtFYiP5HewoKJlDsZ%2Fym9MJOratwTQ9mb3bhJubMItXViaFiSPI8BowsTLnGCxorQFqzSDW9PG05Z4D1jSUBH9Mhn0XE3SM%2BH66V86Tnci%2BdakfPPKnmEzbccndH80Z6m4jfOFQKHWXUuWNb0lBa6WFR9MmesdFj88%2FRRBgooF8chJBXQ9uBZgq%2FAuaY%2Bbyly3iIlMWXpgXUQy1tLuD5Sq7HEF8%2FB5ziU40hTprO%2B2jFPcRPNIhJEFNy%2BJpj%2Fq9ftmp2wYSuTwDF30wnZdZsiVW1pxwjadXMPUEecpeKukqEhtKcyl1IOIlojPFJphRJZZ%2BY0vgBgKhD%2BJZiKG3Kx9FSKT9Dz1sYdfWMQElc6yFFOnZ6R5hpdSHVWxLLdEW8d8S85H5xlSb26Q0JiCNupA4u9jENLdP%2BS02ry0q19vEzYrD%2B%2Fmo6gjXXZa6U66dUlVLSmhl0ZV%2FD17G4DrbZyTZIPv8okvFZpqYvvUTCpivS2BjqcATPuLjpWxhuwUWl1HwkKq2WH3PK4sfLQGRY%2Fmc8xZ0IzU6IDaMosEV%2B4LFr33F1IadIBT9rZVJZ2BBeI6vAQnKMWSeEnjHIXZANw8%2Fk0Kw7DNj46HKVTWfWkDGwH5a3MvBjxo18yawLeYwNSfetGVpS6TMMz8BArcKp7OTbcaLeyXC4Qr%2F0Hoevcuipf9syVdc74eLpb6gIDf9r4Qg%3D%3D)
SPACEBLOCKに拡張パーツを接続する
![](https://s3.ap-northeast-1.amazonaws.com/spaceblock.jp-storage/inquiries/2024-03-26/OzHuWxpp2mPC9mdceQJdQ.png?AWSAccessKeyId=ASIAZZVIWFLRYPYCASPF&Expires=1725770654&Signature=qIsu0ZRzljNZfJdVU2Uqn8kmOok%3D&x-amz-security-token=IQoJb3JpZ2luX2VjEBIaDmFwLW5vcnRoZWFzdC0xIkgwRgIhAMKKk4aPUJn0e3SMDa3%2FAteardhsO4C2QmZ%2FkpDJXcREAiEA5h1%2BhXMSAVKKhjvcAZ3JU%2FoECFek1D9LtUesx0G6ZkcqlAMIOxABGgw2NzM1ODk4OTc5NTUiDLP6gTNK2iBRQ0QEgCrxAre5ARThtFYiP5HewoKJlDsZ%2Fym9MJOratwTQ9mb3bhJubMItXViaFiSPI8BowsTLnGCxorQFqzSDW9PG05Z4D1jSUBH9Mhn0XE3SM%2BH66V86Tnci%2BdakfPPKnmEzbccndH80Z6m4jfOFQKHWXUuWNb0lBa6WFR9MmesdFj88%2FRRBgooF8chJBXQ9uBZgq%2FAuaY%2Bbyly3iIlMWXpgXUQy1tLuD5Sq7HEF8%2FB5ziU40hTprO%2B2jFPcRPNIhJEFNy%2BJpj%2Fq9ftmp2wYSuTwDF30wnZdZsiVW1pxwjadXMPUEecpeKukqEhtKcyl1IOIlojPFJphRJZZ%2BY0vgBgKhD%2BJZiKG3Kx9FSKT9Dz1sYdfWMQElc6yFFOnZ6R5hpdSHVWxLLdEW8d8S85H5xlSb26Q0JiCNupA4u9jENLdP%2BS02ry0q19vEzYrD%2B%2Fmo6gjXXZa6U66dUlVLSmhl0ZV%2FD17G4DrbZyTZIPv8okvFZpqYvvUTCpivS2BjqcATPuLjpWxhuwUWl1HwkKq2WH3PK4sfLQGRY%2Fmc8xZ0IzU6IDaMosEV%2B4LFr33F1IadIBT9rZVJZ2BBeI6vAQnKMWSeEnjHIXZANw8%2Fk0Kw7DNj46HKVTWfWkDGwH5a3MvBjxo18yawLeYwNSfetGVpS6TMMz8BArcKp7OTbcaLeyXC4Qr%2F0Hoevcuipf9syVdc74eLpb6gIDf9r4Qg%3D%3D)
細かい部分は次の図を参考にしてください。LEDパネルは、横向きピンソケットに直接つなぐことができますが、今回は扱いやすいようにジャンパーワイヤでつなぎます。3本のワイヤをつなぐ場所が図の通りになるよう注意してください。圧電スピーカーは、赤と黒のワイヤの色を確認して青色ピンソケットの図の通りの場所につなぎます。
![](https://s3.ap-northeast-1.amazonaws.com/spaceblock.jp-storage/inquiries/2024-03-26/J2SoW0LJ2JLWGxihcwcf5.png?AWSAccessKeyId=ASIAZZVIWFLRYPYCASPF&Expires=1725770654&Signature=ckjpQdMHDbPZYHDT4lVuXbFqAu0%3D&x-amz-security-token=IQoJb3JpZ2luX2VjEBIaDmFwLW5vcnRoZWFzdC0xIkgwRgIhAMKKk4aPUJn0e3SMDa3%2FAteardhsO4C2QmZ%2FkpDJXcREAiEA5h1%2BhXMSAVKKhjvcAZ3JU%2FoECFek1D9LtUesx0G6ZkcqlAMIOxABGgw2NzM1ODk4OTc5NTUiDLP6gTNK2iBRQ0QEgCrxAre5ARThtFYiP5HewoKJlDsZ%2Fym9MJOratwTQ9mb3bhJubMItXViaFiSPI8BowsTLnGCxorQFqzSDW9PG05Z4D1jSUBH9Mhn0XE3SM%2BH66V86Tnci%2BdakfPPKnmEzbccndH80Z6m4jfOFQKHWXUuWNb0lBa6WFR9MmesdFj88%2FRRBgooF8chJBXQ9uBZgq%2FAuaY%2Bbyly3iIlMWXpgXUQy1tLuD5Sq7HEF8%2FB5ziU40hTprO%2B2jFPcRPNIhJEFNy%2BJpj%2Fq9ftmp2wYSuTwDF30wnZdZsiVW1pxwjadXMPUEecpeKukqEhtKcyl1IOIlojPFJphRJZZ%2BY0vgBgKhD%2BJZiKG3Kx9FSKT9Dz1sYdfWMQElc6yFFOnZ6R5hpdSHVWxLLdEW8d8S85H5xlSb26Q0JiCNupA4u9jENLdP%2BS02ry0q19vEzYrD%2B%2Fmo6gjXXZa6U66dUlVLSmhl0ZV%2FD17G4DrbZyTZIPv8okvFZpqYvvUTCpivS2BjqcATPuLjpWxhuwUWl1HwkKq2WH3PK4sfLQGRY%2Fmc8xZ0IzU6IDaMosEV%2B4LFr33F1IadIBT9rZVJZ2BBeI6vAQnKMWSeEnjHIXZANw8%2Fk0Kw7DNj46HKVTWfWkDGwH5a3MvBjxo18yawLeYwNSfetGVpS6TMMz8BArcKp7OTbcaLeyXC4Qr%2F0Hoevcuipf9syVdc74eLpb6gIDf9r4Qg%3D%3D)
ジャンパーワイヤの先端は、「ピンヘッダ」か「ピンソケット」のどちらかです。両端の組み合わせで3種類ありますので、使いたい箇所に応じて選びましょう。SPACEBLOCKの「20cmジャンパーワイヤセット」は、3種類のジャンパーワイヤ各40本ずつがセットになっています。
![](https://s3.ap-northeast-1.amazonaws.com/spaceblock.jp-storage/inquiries/2024-03-26/m_NJwLnsGP3um1Fxrnp-b.png?AWSAccessKeyId=ASIAZZVIWFLRYPYCASPF&Expires=1725770654&Signature=hq8HtDzDA0eeDQsx4R6JXxh9vwE%3D&x-amz-security-token=IQoJb3JpZ2luX2VjEBIaDmFwLW5vcnRoZWFzdC0xIkgwRgIhAMKKk4aPUJn0e3SMDa3%2FAteardhsO4C2QmZ%2FkpDJXcREAiEA5h1%2BhXMSAVKKhjvcAZ3JU%2FoECFek1D9LtUesx0G6ZkcqlAMIOxABGgw2NzM1ODk4OTc5NTUiDLP6gTNK2iBRQ0QEgCrxAre5ARThtFYiP5HewoKJlDsZ%2Fym9MJOratwTQ9mb3bhJubMItXViaFiSPI8BowsTLnGCxorQFqzSDW9PG05Z4D1jSUBH9Mhn0XE3SM%2BH66V86Tnci%2BdakfPPKnmEzbccndH80Z6m4jfOFQKHWXUuWNb0lBa6WFR9MmesdFj88%2FRRBgooF8chJBXQ9uBZgq%2FAuaY%2Bbyly3iIlMWXpgXUQy1tLuD5Sq7HEF8%2FB5ziU40hTprO%2B2jFPcRPNIhJEFNy%2BJpj%2Fq9ftmp2wYSuTwDF30wnZdZsiVW1pxwjadXMPUEecpeKukqEhtKcyl1IOIlojPFJphRJZZ%2BY0vgBgKhD%2BJZiKG3Kx9FSKT9Dz1sYdfWMQElc6yFFOnZ6R5hpdSHVWxLLdEW8d8S85H5xlSb26Q0JiCNupA4u9jENLdP%2BS02ry0q19vEzYrD%2B%2Fmo6gjXXZa6U66dUlVLSmhl0ZV%2FD17G4DrbZyTZIPv8okvFZpqYvvUTCpivS2BjqcATPuLjpWxhuwUWl1HwkKq2WH3PK4sfLQGRY%2Fmc8xZ0IzU6IDaMosEV%2B4LFr33F1IadIBT9rZVJZ2BBeI6vAQnKMWSeEnjHIXZANw8%2Fk0Kw7DNj46HKVTWfWkDGwH5a3MvBjxo18yawLeYwNSfetGVpS6TMMz8BArcKp7OTbcaLeyXC4Qr%2F0Hoevcuipf9syVdc74eLpb6gIDf9r4Qg%3D%3D)
圧電スピーカーをプログラムするには?
![](https://s3.ap-northeast-1.amazonaws.com/spaceblock.jp-storage/inquiries/2024-03-26/u2s3nlyfS9GcxtKwEnh_-.png?AWSAccessKeyId=ASIAZZVIWFLRYPYCASPF&Expires=1725770654&Signature=qEcB2LvCFXjJdL1A7xQhBqpJGA4%3D&x-amz-security-token=IQoJb3JpZ2luX2VjEBIaDmFwLW5vcnRoZWFzdC0xIkgwRgIhAMKKk4aPUJn0e3SMDa3%2FAteardhsO4C2QmZ%2FkpDJXcREAiEA5h1%2BhXMSAVKKhjvcAZ3JU%2FoECFek1D9LtUesx0G6ZkcqlAMIOxABGgw2NzM1ODk4OTc5NTUiDLP6gTNK2iBRQ0QEgCrxAre5ARThtFYiP5HewoKJlDsZ%2Fym9MJOratwTQ9mb3bhJubMItXViaFiSPI8BowsTLnGCxorQFqzSDW9PG05Z4D1jSUBH9Mhn0XE3SM%2BH66V86Tnci%2BdakfPPKnmEzbccndH80Z6m4jfOFQKHWXUuWNb0lBa6WFR9MmesdFj88%2FRRBgooF8chJBXQ9uBZgq%2FAuaY%2Bbyly3iIlMWXpgXUQy1tLuD5Sq7HEF8%2FB5ziU40hTprO%2B2jFPcRPNIhJEFNy%2BJpj%2Fq9ftmp2wYSuTwDF30wnZdZsiVW1pxwjadXMPUEecpeKukqEhtKcyl1IOIlojPFJphRJZZ%2BY0vgBgKhD%2BJZiKG3Kx9FSKT9Dz1sYdfWMQElc6yFFOnZ6R5hpdSHVWxLLdEW8d8S85H5xlSb26Q0JiCNupA4u9jENLdP%2BS02ry0q19vEzYrD%2B%2Fmo6gjXXZa6U66dUlVLSmhl0ZV%2FD17G4DrbZyTZIPv8okvFZpqYvvUTCpivS2BjqcATPuLjpWxhuwUWl1HwkKq2WH3PK4sfLQGRY%2Fmc8xZ0IzU6IDaMosEV%2B4LFr33F1IadIBT9rZVJZ2BBeI6vAQnKMWSeEnjHIXZANw8%2Fk0Kw7DNj46HKVTWfWkDGwH5a3MvBjxo18yawLeYwNSfetGVpS6TMMz8BArcKp7OTbcaLeyXC4Qr%2F0Hoevcuipf9syVdc74eLpb6gIDf9r4Qg%3D%3D)
ブロックのピンソケット名をクリックすると一覧が表示されて、4箇所のピンソケットがハイライトされています。圧電スピーカーは、赤のジャンパーワイヤをこれら4箇所のどれかに接続し、黒のワイヤを「GND」と書かれたピンソケットに接続して使います。
![](https://s3.ap-northeast-1.amazonaws.com/spaceblock.jp-storage/inquiries/2024-03-26/MHcK5NSlOpZYX_lTkuYAG.png?AWSAccessKeyId=ASIAZZVIWFLRYPYCASPF&Expires=1725770654&Signature=90Xs%2B%2BcESFN7OgFhfnM4JcqEwbU%3D&x-amz-security-token=IQoJb3JpZ2luX2VjEBIaDmFwLW5vcnRoZWFzdC0xIkgwRgIhAMKKk4aPUJn0e3SMDa3%2FAteardhsO4C2QmZ%2FkpDJXcREAiEA5h1%2BhXMSAVKKhjvcAZ3JU%2FoECFek1D9LtUesx0G6ZkcqlAMIOxABGgw2NzM1ODk4OTc5NTUiDLP6gTNK2iBRQ0QEgCrxAre5ARThtFYiP5HewoKJlDsZ%2Fym9MJOratwTQ9mb3bhJubMItXViaFiSPI8BowsTLnGCxorQFqzSDW9PG05Z4D1jSUBH9Mhn0XE3SM%2BH66V86Tnci%2BdakfPPKnmEzbccndH80Z6m4jfOFQKHWXUuWNb0lBa6WFR9MmesdFj88%2FRRBgooF8chJBXQ9uBZgq%2FAuaY%2Bbyly3iIlMWXpgXUQy1tLuD5Sq7HEF8%2FB5ziU40hTprO%2B2jFPcRPNIhJEFNy%2BJpj%2Fq9ftmp2wYSuTwDF30wnZdZsiVW1pxwjadXMPUEecpeKukqEhtKcyl1IOIlojPFJphRJZZ%2BY0vgBgKhD%2BJZiKG3Kx9FSKT9Dz1sYdfWMQElc6yFFOnZ6R5hpdSHVWxLLdEW8d8S85H5xlSb26Q0JiCNupA4u9jENLdP%2BS02ry0q19vEzYrD%2B%2Fmo6gjXXZa6U66dUlVLSmhl0ZV%2FD17G4DrbZyTZIPv8okvFZpqYvvUTCpivS2BjqcATPuLjpWxhuwUWl1HwkKq2WH3PK4sfLQGRY%2Fmc8xZ0IzU6IDaMosEV%2B4LFr33F1IadIBT9rZVJZ2BBeI6vAQnKMWSeEnjHIXZANw8%2Fk0Kw7DNj46HKVTWfWkDGwH5a3MvBjxo18yawLeYwNSfetGVpS6TMMz8BArcKp7OTbcaLeyXC4Qr%2F0Hoevcuipf9syVdc74eLpb6gIDf9r4Qg%3D%3D)
今回使用するのは、青色ピンソケットの「GND」と「A0(T2)」です。[《A0(T2)》から《中のド》を《1000》(ミリ秒)鳴らす]ブロックで「A0(T2)」を選択しましょう
![](https://s3.ap-northeast-1.amazonaws.com/spaceblock.jp-storage/inquiries/2024-03-26/H0wN2KA51eq1uL5zL_Efx.png?AWSAccessKeyId=ASIAZZVIWFLRYPYCASPF&Expires=1725770654&Signature=uu%2FuR3KC3xvuV%2BFGpzpUfohaer8%3D&x-amz-security-token=IQoJb3JpZ2luX2VjEBIaDmFwLW5vcnRoZWFzdC0xIkgwRgIhAMKKk4aPUJn0e3SMDa3%2FAteardhsO4C2QmZ%2FkpDJXcREAiEA5h1%2BhXMSAVKKhjvcAZ3JU%2FoECFek1D9LtUesx0G6ZkcqlAMIOxABGgw2NzM1ODk4OTc5NTUiDLP6gTNK2iBRQ0QEgCrxAre5ARThtFYiP5HewoKJlDsZ%2Fym9MJOratwTQ9mb3bhJubMItXViaFiSPI8BowsTLnGCxorQFqzSDW9PG05Z4D1jSUBH9Mhn0XE3SM%2BH66V86Tnci%2BdakfPPKnmEzbccndH80Z6m4jfOFQKHWXUuWNb0lBa6WFR9MmesdFj88%2FRRBgooF8chJBXQ9uBZgq%2FAuaY%2Bbyly3iIlMWXpgXUQy1tLuD5Sq7HEF8%2FB5ziU40hTprO%2B2jFPcRPNIhJEFNy%2BJpj%2Fq9ftmp2wYSuTwDF30wnZdZsiVW1pxwjadXMPUEecpeKukqEhtKcyl1IOIlojPFJphRJZZ%2BY0vgBgKhD%2BJZiKG3Kx9FSKT9Dz1sYdfWMQElc6yFFOnZ6R5hpdSHVWxLLdEW8d8S85H5xlSb26Q0JiCNupA4u9jENLdP%2BS02ry0q19vEzYrD%2B%2Fmo6gjXXZa6U66dUlVLSmhl0ZV%2FD17G4DrbZyTZIPv8okvFZpqYvvUTCpivS2BjqcATPuLjpWxhuwUWl1HwkKq2WH3PK4sfLQGRY%2Fmc8xZ0IzU6IDaMosEV%2B4LFr33F1IadIBT9rZVJZ2BBeI6vAQnKMWSeEnjHIXZANw8%2Fk0Kw7DNj46HKVTWfWkDGwH5a3MvBjxo18yawLeYwNSfetGVpS6TMMz8BArcKp7OTbcaLeyXC4Qr%2F0Hoevcuipf9syVdc74eLpb6gIDf9r4Qg%3D%3D)
「GND」は「グランド」と呼びます。拡張パーツを接続するときは、必ず1本のジャンパーワイヤを「GND」につなぎます。プラスからマイナスに電気が流れていくマイナスの側にあたるのが「GND」で、電気の通り道を作るのに必要です。「GND」はどこを使っても違いはなく、プログラムブロックで指定することもありません。
![](https://s3.ap-northeast-1.amazonaws.com/spaceblock.jp-storage/inquiries/2024-03-26/G4_u-3AQZggVi27wnhrBj.png?AWSAccessKeyId=ASIAZZVIWFLRYPYCASPF&Expires=1725770654&Signature=CyIdjHQZn79oo17uGh2eo39XgQ4%3D&x-amz-security-token=IQoJb3JpZ2luX2VjEBIaDmFwLW5vcnRoZWFzdC0xIkgwRgIhAMKKk4aPUJn0e3SMDa3%2FAteardhsO4C2QmZ%2FkpDJXcREAiEA5h1%2BhXMSAVKKhjvcAZ3JU%2FoECFek1D9LtUesx0G6ZkcqlAMIOxABGgw2NzM1ODk4OTc5NTUiDLP6gTNK2iBRQ0QEgCrxAre5ARThtFYiP5HewoKJlDsZ%2Fym9MJOratwTQ9mb3bhJubMItXViaFiSPI8BowsTLnGCxorQFqzSDW9PG05Z4D1jSUBH9Mhn0XE3SM%2BH66V86Tnci%2BdakfPPKnmEzbccndH80Z6m4jfOFQKHWXUuWNb0lBa6WFR9MmesdFj88%2FRRBgooF8chJBXQ9uBZgq%2FAuaY%2Bbyly3iIlMWXpgXUQy1tLuD5Sq7HEF8%2FB5ziU40hTprO%2B2jFPcRPNIhJEFNy%2BJpj%2Fq9ftmp2wYSuTwDF30wnZdZsiVW1pxwjadXMPUEecpeKukqEhtKcyl1IOIlojPFJphRJZZ%2BY0vgBgKhD%2BJZiKG3Kx9FSKT9Dz1sYdfWMQElc6yFFOnZ6R5hpdSHVWxLLdEW8d8S85H5xlSb26Q0JiCNupA4u9jENLdP%2BS02ry0q19vEzYrD%2B%2Fmo6gjXXZa6U66dUlVLSmhl0ZV%2FD17G4DrbZyTZIPv8okvFZpqYvvUTCpivS2BjqcATPuLjpWxhuwUWl1HwkKq2WH3PK4sfLQGRY%2Fmc8xZ0IzU6IDaMosEV%2B4LFr33F1IadIBT9rZVJZ2BBeI6vAQnKMWSeEnjHIXZANw8%2Fk0Kw7DNj46HKVTWfWkDGwH5a3MvBjxo18yawLeYwNSfetGVpS6TMMz8BArcKp7OTbcaLeyXC4Qr%2F0Hoevcuipf9syVdc74eLpb6gIDf9r4Qg%3D%3D)
「GND」につないだ黒のジャンパーワイヤはそのまま、赤のワイヤを黄色ピンソケットの「B0(T3)」につなぎかえ、プログラムを[《B0(T3)》から《中のド》を《1000》(ミリ秒)鳴らす]に修正してプログラムを実行してみましょう。全く同じように機能します。
「オカエリ」電光表示に音を足そう
![](https://s3.ap-northeast-1.amazonaws.com/spaceblock.jp-storage/inquiries/2024-03-26/3c3duFkIeCbzuKpJdKreu.png?AWSAccessKeyId=ASIAZZVIWFLRYPYCASPF&Expires=1725770654&Signature=lcQKRgzneLzBlVWt1ohYdGT4SM8%3D&x-amz-security-token=IQoJb3JpZ2luX2VjEBIaDmFwLW5vcnRoZWFzdC0xIkgwRgIhAMKKk4aPUJn0e3SMDa3%2FAteardhsO4C2QmZ%2FkpDJXcREAiEA5h1%2BhXMSAVKKhjvcAZ3JU%2FoECFek1D9LtUesx0G6ZkcqlAMIOxABGgw2NzM1ODk4OTc5NTUiDLP6gTNK2iBRQ0QEgCrxAre5ARThtFYiP5HewoKJlDsZ%2Fym9MJOratwTQ9mb3bhJubMItXViaFiSPI8BowsTLnGCxorQFqzSDW9PG05Z4D1jSUBH9Mhn0XE3SM%2BH66V86Tnci%2BdakfPPKnmEzbccndH80Z6m4jfOFQKHWXUuWNb0lBa6WFR9MmesdFj88%2FRRBgooF8chJBXQ9uBZgq%2FAuaY%2Bbyly3iIlMWXpgXUQy1tLuD5Sq7HEF8%2FB5ziU40hTprO%2B2jFPcRPNIhJEFNy%2BJpj%2Fq9ftmp2wYSuTwDF30wnZdZsiVW1pxwjadXMPUEecpeKukqEhtKcyl1IOIlojPFJphRJZZ%2BY0vgBgKhD%2BJZiKG3Kx9FSKT9Dz1sYdfWMQElc6yFFOnZ6R5hpdSHVWxLLdEW8d8S85H5xlSb26Q0JiCNupA4u9jENLdP%2BS02ry0q19vEzYrD%2B%2Fmo6gjXXZa6U66dUlVLSmhl0ZV%2FD17G4DrbZyTZIPv8okvFZpqYvvUTCpivS2BjqcATPuLjpWxhuwUWl1HwkKq2WH3PK4sfLQGRY%2Fmc8xZ0IzU6IDaMosEV%2B4LFr33F1IadIBT9rZVJZ2BBeI6vAQnKMWSeEnjHIXZANw8%2Fk0Kw7DNj46HKVTWfWkDGwH5a3MvBjxo18yawLeYwNSfetGVpS6TMMz8BArcKp7OTbcaLeyXC4Qr%2F0Hoevcuipf9syVdc74eLpb6gIDf9r4Qg%3D%3D)
一文字ごとに音が鳴るように、プログラムを追加します。次の図の通り「ミ」「ド」「レ」「ソ」の音を1000ミリ秒ずつ鳴らすブロックを入れます。
![](https://s3.ap-northeast-1.amazonaws.com/spaceblock.jp-storage/inquiries/2024-03-26/UIZG-iVbI3xnKmFsrqf6j.png?AWSAccessKeyId=ASIAZZVIWFLRYPYCASPF&Expires=1725770654&Signature=cg11cgsxaIhXUdS6uASeMhtsQh4%3D&x-amz-security-token=IQoJb3JpZ2luX2VjEBIaDmFwLW5vcnRoZWFzdC0xIkgwRgIhAMKKk4aPUJn0e3SMDa3%2FAteardhsO4C2QmZ%2FkpDJXcREAiEA5h1%2BhXMSAVKKhjvcAZ3JU%2FoECFek1D9LtUesx0G6ZkcqlAMIOxABGgw2NzM1ODk4OTc5NTUiDLP6gTNK2iBRQ0QEgCrxAre5ARThtFYiP5HewoKJlDsZ%2Fym9MJOratwTQ9mb3bhJubMItXViaFiSPI8BowsTLnGCxorQFqzSDW9PG05Z4D1jSUBH9Mhn0XE3SM%2BH66V86Tnci%2BdakfPPKnmEzbccndH80Z6m4jfOFQKHWXUuWNb0lBa6WFR9MmesdFj88%2FRRBgooF8chJBXQ9uBZgq%2FAuaY%2Bbyly3iIlMWXpgXUQy1tLuD5Sq7HEF8%2FB5ziU40hTprO%2B2jFPcRPNIhJEFNy%2BJpj%2Fq9ftmp2wYSuTwDF30wnZdZsiVW1pxwjadXMPUEecpeKukqEhtKcyl1IOIlojPFJphRJZZ%2BY0vgBgKhD%2BJZiKG3Kx9FSKT9Dz1sYdfWMQElc6yFFOnZ6R5hpdSHVWxLLdEW8d8S85H5xlSb26Q0JiCNupA4u9jENLdP%2BS02ry0q19vEzYrD%2B%2Fmo6gjXXZa6U66dUlVLSmhl0ZV%2FD17G4DrbZyTZIPv8okvFZpqYvvUTCpivS2BjqcATPuLjpWxhuwUWl1HwkKq2WH3PK4sfLQGRY%2Fmc8xZ0IzU6IDaMosEV%2B4LFr33F1IadIBT9rZVJZ2BBeI6vAQnKMWSeEnjHIXZANw8%2Fk0Kw7DNj46HKVTWfWkDGwH5a3MvBjxo18yawLeYwNSfetGVpS6TMMz8BArcKp7OTbcaLeyXC4Qr%2F0Hoevcuipf9syVdc74eLpb6gIDf9r4Qg%3D%3D)
これで、音が出る電光表示になりました。動画で見てみましょう。チャイムのような音の効果が追加できました。