Component: Buzzer (Audio Output): Difference between revisions
No edit summary |
m Text replacement - "style="background-color:#EAE1EA;"" to "class="mtx-class-propfolder"" |
||
| (9 intermediate revisions by 2 users not shown) | |||
| Line 94: | Line 94: | ||
{{Fcfile|Basic Buzzer Example.fcfx|Basic Buzzer Example}} | {{Fcfile|Basic Buzzer Example.fcfx|Basic Buzzer Example}} | ||
| Line 99: | Line 107: | ||
==Macro reference== | ==Macro reference== | ||
{| class="wikitable | ===BuzzerBeep=== | ||
{| class="mtx-class-macrotable wikitable" | |||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''BuzzerBeep''' | ||
|- | |- | ||
| colspan="2" | Switches the buzzer on and off automatically to allow for a series of beeps | | colspan="2" | Switches the buzzer on and off automatically to allow for a series of beeps | ||
| Line 127: | Line 136: | ||
{| class="wikitable | ===BuzzerOff=== | ||
{| class="mtx-class-macrotable wikitable" | |||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''BuzzerOff''' | ||
|- | |- | ||
| colspan="2" | Switch Off the Buzzer | | colspan="2" | Switch Off the Buzzer | ||
| Line 140: | Line 150: | ||
{| class="wikitable | ===BuzzerOn=== | ||
{| class="mtx-class-macrotable wikitable" | |||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''BuzzerOn''' | ||
|- | |- | ||
| colspan="2" | Switch On the Buzzer | | colspan="2" | Switch On the Buzzer | ||
| Line 153: | Line 164: | ||
{| class="wikitable | ===BuzzerOnDelay=== | ||
{| class="mtx-class-macrotable wikitable" | |||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''BuzzerOnDelay''' | ||
|- | |- | ||
| colspan="2" | Switch the Buzzer on for a fixed amount of time | | colspan="2" | Switch the Buzzer on for a fixed amount of time | ||
| Line 169: | Line 181: | ||
| width="90%" style="border-top: 2px solid #000;" | ''Return'' | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
|} | |} | ||
==Property reference== | ==Property reference== | ||
{| class="wikitable | {| class="mtx-class-macrotable wikitable" | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-prop-icon.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''Properties''' | ||
|- | |- | ||
|- | |- | ||
| Line 191: | Line 201: | ||
| colspan="2" | Controls the pin state required to switch the buzzer on. | | colspan="2" | Controls the pin state required to switch the buzzer on. | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-propfolder" | [[File:Fc9-conn-icon.png]] | ||
| width="90%" | | width="90%" class="mtx-class-propfolder" | Simulation | ||
|- | |- | ||
|- | |- | ||
Latest revision as of 14:37, 13 July 2026
| Author | Matrix TSL |
| Version | 1.0 |
| Category | Audio Output |
Buzzer component
Drives a simple fixed frequency buzzer in hardware and simulates the sound of a buzzer in simulation. To actually drive a buzzer you would have to amplify the signal from the microcontroller using a transistor or MOSFET.
Component Source Code
Please click here to download the component source project: FC_Comp_Source_Buzzer.fcfx
Please click here to view the component source code (Beta): FC_Comp_Source_Buzzer.fcfx
Detailed description
No detailed description exists yet for this component
Examples
Depending on your Buzzer you may need to amplify the signal from the microcontroller using a NPN transistor or N channel FET.
A basic buzzer example using all the buzzer functions.
It should be noted that if you have a single BuzzerOn component with no loop, the buzzer sound will stop when the simulation stops.
The pin will remain high.
While the buzzer is on, the simulation tone is not continuous, it rapidly pulses, the pin will remain high.
That is not a bug with the component
Macro reference
BuzzerBeep
BuzzerOff
| BuzzerOff | |
| Switch Off the Buzzer | |
| Return | |
BuzzerOn
| BuzzerOn | |
| Switch On the Buzzer | |
| Return | |
BuzzerOnDelay
| BuzzerOnDelay | |
| Switch the Buzzer on for a fixed amount of time | |
| Time | |
| Time in milliseconds to keep the buzzer on | |
| Return | |
