Page 1 of 1

Buzzer component

Posted: Mon Jan 19, 2026 2:31 am
by Billduck1302
I am using the stock component. To play more than 1 tone, it seems that one has to add the component for each tone.
It would be nice if one could specify the pitch and duration when calling it.

Re: Buzzer component

Posted: Mon Jan 19, 2026 9:43 am
by medelec35
Hello.
That is not how the Buzzer component is intended to work.
The Buzzer component is a single fixed frequency component only sets an output to high or low, depending the buzzer is on or off.
With actual hardware to make it buzz, a fixed DC supply e.g. 9v is used to enable buzzer.
For a buzzer of different frequencies, then a loud speaker, amplifier and PWM will be required.
If less harsh tone, then you could use a DS sine generator.

Re: Buzzer component

Posted: Mon Jan 19, 2026 9:45 am
by BenR
Hello,

The Buzzer component is targetting fixed frequency buzzers, while the simulation outputs a tone the hardware will simply turn an output on and off. Martin beat me to it ;)

I beleive what you're after is the Piezo component which targets a variable frequency device which is much more like a solid state speaker. This requires a audio frequency output to it and has a function "BuzzerOnDelay" which has the two parameters you specified.

Hope this helps.