Difference between revisions of "Component: Buzzer (Audio Output)"
(11 intermediate revisions by the same user not shown) | |||
Line 15: | Line 15: | ||
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. | 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 | + | ==Component Source Code== |
− | + | Please click here to download the component source project: [https://www.flowcode.co.uk/wiki/componentsource/FC_Comp_Source_Buzzer.fcfx FC_Comp_Source_Buzzer.fcfx] | |
+ | |||
+ | Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/FC_Comp_Source_Buzzer.fcfx FC_Comp_Source_Buzzer.fcfx] | ||
==Detailed description== | ==Detailed description== | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
Line 32: | Line 50: | ||
==Examples== | ==Examples== | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
Line 61: | Line 95: | ||
{{Fcfile|Basic Buzzer Example.fcfx|Basic Buzzer Example}} | {{Fcfile|Basic Buzzer Example.fcfx|Basic Buzzer Example}} | ||
− | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | ==Macro reference== | ||
+ | |||
+ | ===BuzzerBeep=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 91: | Line 136: | ||
+ | ===BuzzerOff=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 104: | Line 150: | ||
+ | ===BuzzerOn=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 117: | Line 164: | ||
+ | ===BuzzerOnDelay=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 133: | Line 181: | ||
| width="90%" style="border-top: 2px solid #000;" | ''Return'' | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
|} | |} | ||
− | |||
− | |||
Line 155: | 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" | [[File:Fc9- | + | | width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]] |
− | | width="90%" | | + | | width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Simulation |
|- | |- | ||
− | |||
|- | |- | ||
| width="10%" align="center" | [[File:Fc9-type-21-icon.png]] | | width="10%" align="center" | [[File:Fc9-type-21-icon.png]] | ||
Line 164: | Line 209: | ||
|- | |- | ||
| colspan="2" | Frequency of the buzzer in Hz to drive the simulation | | colspan="2" | Frequency of the buzzer in Hz to drive the simulation | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
|} | |} |
Latest revision as of 13:08, 7 February 2023
Author | Matrix TSL |
Version | 1.0 |
Category | Audio Output |
Contents
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 |