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.
Buzzer component
-
Billduck1302
- Posts: 34
- http://meble-kuchenne.info.pl
- Joined: Fri Dec 06, 2024 4:41 pm
- Has thanked: 2 times
- Been thanked: 1 time
-
medelec35
- Valued Contributor
- Posts: 2234
- Joined: Wed Dec 02, 2020 11:07 pm
- Has thanked: 686 times
- Been thanked: 759 times
Re: Buzzer component
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.
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
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.
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.
Regards Ben Rowland - MatrixTSL
Flowcode Online Code Viewer (Beta) - Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel
Flowcode Online Code Viewer (Beta) - Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel