# A06. 蜂鳴器播放聲音

### 專案說明 <a href="#a06.-feng-ming-qi-bo-fang-sheng-yin-zhuan-an-shui-ming" id="a06.-feng-ming-qi-bo-fang-sheng-yin-zhuan-an-shui-ming"></a>

外接蜂鳴器 (Buzzer) 播放一段[小星星](https://zh.wikipedia.org/wiki/%E4%B8%80%E9%96%83%E4%B8%80%E9%96%83%E5%B0%8F%E6%98%9F%E6%98%9F)

### 電路圖 <a href="#a06.-feng-ming-qi-bo-fang-sheng-yin-dian-lu-tu" id="a06.-feng-ming-qi-bo-fang-sheng-yin-dian-lu-tu"></a>

* [LinkIt 7697](https://robotkingdom.com.tw/product/linkit-7697/)
* 麵包板
* 蜂鳴器&#x20;
* 220Ω 電阻
* 杜邦線

![](/files/E1oQeZtn2xzYkLxslgzy)

(圖片由 [Fritzing](http://fritzing.org/home/) 產生, LinkIt 7697 fritzing [下載](https://www.dropbox.com/s/44rgxihq1nri2qn/linkit_7697_fritzing_and_diagrams.zip))

### 積木畫布 <a href="#a06.-feng-ming-qi-bo-fang-sheng-yin-ji-mu-hua-bu" id="a06.-feng-ming-qi-bo-fang-sheng-yin-ji-mu-hua-bu"></a>

這些 Do， Re， Mi， Fa， So 等積木， 預設是播放 300 毫秒 (ms)， 所以後面要加個 500 毫秒的延遲， 中間有 200 毫秒的空檔， 才會聽到斷音

![](/files/euhlW2ek0rEsS1V5QYVZ)

產生出的 Arduino 程式如下

```
void setup()
{

}

void loop()
{
  tone(3,392,300);
  delay(500);
  tone(3,330,300);
  delay(500);
  tone(3,330,300);
  delay(1000);
  tone(3,349,300);
  delay(500);
  tone(3,294,300);
  delay(500);
  tone(3,294,300);
  delay(1000);
  tone(3,262,300);
  delay(500);
  tone(3,294,300);
  delay(500);
  tone(3,330,300);
  delay(500);
  tone(3,349,300);
  delay(500);
  tone(3,392,300);
  delay(500);
  tone(3,392,300);
  delay(500);
  tone(3,392,300);
  delay(3000);
}
```

<br>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://cavedu.gitbook.io/linkit-7697/linkit-7697-blocklyduino-shi-yong-zhi-nan/shi-zuo-fan-li-jiao-xue/a06.-feng-ming-qi-bo-fang-sheng-yin.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
