Buzzer component

Post here to discuss any new features, components, chips, etc, that you would like to see in Flowcode.
Post Reply
Billduck1302
Posts: 34
http://meble-kuchenne.info.pl
Joined: Fri Dec 06, 2024 4:41 pm
Has thanked: 2 times
Been thanked: 1 time

Buzzer component

Post 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.

medelec35
Valued Contributor
Posts: 2234
Joined: Wed Dec 02, 2020 11:07 pm
Has thanked: 686 times
Been thanked: 759 times

Re: Buzzer component

Post 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.
Martin

BenR
Matrix Staff
Posts: 2095
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 556 times
Been thanked: 740 times

Re: Buzzer component

Post 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.

Post Reply