# 有源蜂鳴器模組

## 有源蜂鳴器模組 <a href="#hlk168942250" id="hlk168942250"></a>

**專案說明**

使用「Raspberry Pi Pico W」連接「有源蜂鳴器模組」, 觸發有源蜂鳴器模組發出聲音。此 **有源蜂鳴器模組**包含於「洞洞五教學材料包」內。

### **有源蜂鳴器模組電路圖**

* Raspberry Pi Pico W
* Raspberry Pi Pico W 擴充板
* 有源蜂鳴器模組

**有源蜂鳴器模組**是**數位訊號**輸入， 可以接「D0\~ D28」的Raspberry Pi Pico擴充板訊號端上。 本範例連接到「D7」。

![](/files/saJUNiuvoxJtchaEPW2j)

### **BlocklyDuino 程式(Buzzer)**

蜂鳴器會被開啟一秒後，關閉一秒，如此周而復始，直到 Raspberry Pi Pico W 斷電為止。

![](/files/Tl5Y5xjfPTA3a49evsX3)

### **Arduino 程式(Buzzer.ino)如下**

```
void setup()
{
pinMode(7, OUTPUT);
}
void loop()
{
digitalWrite(7, HIGH);
delay(1000);
digitalWrite(7, LOW);
delay(1000);
}
```


---

# 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/cavedu/rk005/module_ui/buzzer.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.
