作者存档:Kelvin Wong

有源 vs 无源蜂鸣器:Arduino 分辨、接线与 tone() 旋律

Cartoon of two blue buzzer modules with black buzzer cans side by side, the left emitting three identical teal sound arcs, the right fed by a teal square wave and emitting arcs of varying size

有源蜂鸣器自带震荡电路,一段稳定的直流就让它一直响同一个音;无源蜂鸣器只是一颗裸的发声元件,你送什么波形,它才发什么声音。这篇教你一眼分辨两者、把它们接到 Arduino Uno 上、用 tone() 放一段旋律,最后做一个只在该响的时候才响的震动警报器。