SKU:U132












Unit Buzzer は、パッシブブザーをベースとした高効率な音声フィードバックユニットです。外部からの PWM 方形波信号によって振動板を駆動し、ブザーアラームやカスタム通知音の再生を実現します。本ユニットは Grove HY2.0-4P インターフェースを採用し、保護回路付きの NPN トランジスタドライバを内蔵しています。推奨駆動周波数は 4KHz で、72dB の明瞭な音圧を実現します。また、LEGO 互換の取付穴設計により、LEGO 構造への柔軟な組み込みやネジ固定が容易です。警報システム、ユーザーインタラクション通知、スマートデバイスのフィードバックなどの用途に適しています。
| 仕様 | パラメータ |
|---|---|
| 駆動周波数 | 4KHz 1/2duty 矩形波 |
| 消費電力 | 5V@86mA |
| 製品サイズ | 24.0 x 24.0 x 8.0mm |
| 製品重量 | 3.3g |
| 梱包サイズ | 138.0 x 93.0 x 9.0mm |
| 梱包重量 | 6.8g |
| M5CORE - PORT B | G26 |
|---|---|
| BUZZER | SIGNAL |
#include <Arduino.h>
#define buzzer_pin 26
int freq = 4000;
int ledChannel = 0;
int resolution = 10;
void setup() {
ledcSetup(ledChannel, freq, resolution); //Sets the frequency and number of counts corresponding to the channel. 设置通道对应的频率和计数位数
ledcAttachPin(buzzer_pin, ledChannel); //Binds the specified channel to the specified I/O port for output. 将指定通道绑定到指定 IO 口上以实现输出
ledcWrite(ledChannel, 512); //Output PWM. 输出PWM
}
void loop() {
ledcWrite(ledChannel, 512); //Output PWM. 输出PWM
delay(3000);
ledcWrite(ledChannel, 0); //Output PWM. 输出PWM
delay(3000);
}