Difference between revisions of "Component: Piezo Sounder (Audio Output)"

From Flowcode Help
Jump to navigationJump to search
 
(11 intermediate revisions by the same user not shown)
Line 14: Line 14:
 
==Piezo Sounder component==
 
==Piezo Sounder component==
 
Drives a simple variable frequency piezo sounder in hardware and simulates the sound in simulation. To actually drive a piezo you may have to amplify the signal from the microcontroller using a transistor or MOSFET.
 
Drives a simple variable frequency piezo sounder in hardware and simulates the sound in simulation. To actually drive a piezo you may 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: [https://www.flowcode.co.uk/wiki/componentsource/FC_Comp_Source_PiezoSounder.fcfx FC_Comp_Source_PiezoSounder.fcfx]
 +
 +
Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/FC_Comp_Source_PiezoSounder.fcfx FC_Comp_Source_PiezoSounder.fcfx]
  
 
==Detailed description==
 
==Detailed description==
 +
 +
 +
 +
 +
 +
 +
 +
 +
 +
 +
 +
 +
 +
 +
 +
  
  
Line 28: Line 50:
  
 
==Examples==
 
==Examples==
 +
 +
 +
 +
 +
 +
 +
 +
 +
 +
 +
 +
 +
 +
 +
 +
  
  
Line 45: Line 83:
 
[[File:BuzzerWire.jpg]]
 
[[File:BuzzerWire.jpg]]
  
==Downloadable macro reference==
 
  
 +
 +
 +
 +
 +
 +
 +
 +
 +
 +
==Macro reference==
 +
 +
===BuzzerBeep===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
Line 80: Line 129:
  
  
 +
===BuzzerOnDelay===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
Line 101: Line 151:
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
|}
 
 
  
  
Line 117: Line 165:
 
|-
 
|-
 
| colspan="2" | Pin used to drive the output to the buzzer 
 
| colspan="2" | Pin used to drive the output to the buzzer 
|-
 
| width="10%" align="center" | [[File:Fc9-type-1-icon.png]]
 
| width="90%" | Color
 
|-
 
| colspan="2" | Controls the color of the Buzzer object on the panel. 
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-conn-icon.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Connections'''
 
|-
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-conn-icon.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Simulations'''
 
|-
 
 
|}
 
|}

Latest revision as of 13:12, 7 February 2023

Author Matrix TSL
Version 1.0
Category Audio Output


Piezo Sounder component

Drives a simple variable frequency piezo sounder in hardware and simulates the sound in simulation. To actually drive a piezo you may 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_PiezoSounder.fcfx

Please click here to view the component source code (Beta): FC_Comp_Source_PiezoSounder.fcfx

Detailed description

No detailed description exists yet for this component

Examples

Here is a simple example that will create a siren effect using a piezo sounder. FC6 Icon.png Piezo Siren Depending on your Piezo Sounder you may need to amplify the signal from the microcontroller using a NPN transistor or N channel FET.


BuzzerWire.jpg






Macro reference

BuzzerBeep

Fc9-comp-macro.png BuzzerBeep
Switches the buzzer on and off automatically to allow for a series of beeps 
Fc9-u16-icon.png - UINT OnTime
Length of time in ms the buzzer will remain on 
Fc9-u16-icon.png - UINT OffTime
Length of time in ms the buzzer will remain off 
Fc9-u8-icon.png - BYTE NumberLoops
Number of times to repeat the sequence. Range 1-255 
Fc9-u16-icon.png - UINT Frequency
frequency in hz to output to the Piezo sounder 
Fc9-void-icon.png - VOID Return


BuzzerOnDelay

Fc9-comp-macro.png BuzzerOnDelay
Switch the Buzzer on for a fixed amount of time 
Fc9-u16-icon.png - UINT Time
Time in milliseconds to keep the buzzer on 
Fc9-u16-icon.png - UINT Frequency
Frequency to output in Hz 
Fc9-void-icon.png - VOID Return


Property reference

Fc9-prop-icon.png Properties
Fc9-type-5-icon.png Output Pin
Pin used to drive the output to the buzzer