> For the complete documentation index, see [llms.txt](https://ubtechedu.gitbook.io/chinese/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ubtechedu.gitbook.io/chinese/standard/onborad/buzzer/tone.md).

# tone(frequency, duration)

设置板载蜂鸣器发声

### 参数

| 参数名       | 类型            | 描述           |
| --------- | ------------- | ------------ |
| frequency | unsigned int  | 产生声音的频率，单位Hz |
| duration  | unsigned long | 声音持续的时间，单位毫秒 |

### 例子

用uKitExplore v2板子控制板载蜂鸣器发131Hz声音，持续400ms：

```c
#include "uKitExplore2.h"
void setup() {
    Initialization();
    tone(131,400);
}
void loop() {
    
}
```
