Jump to content

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

From Flowcode Help
No edit summary
No edit summary
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 Pack==
BASICIO


==Detailed description==
==Detailed description==




Line 28: Line 34:


==Examples==
==Examples==




Line 117: Line 125:
|-
|-
| 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="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-conn-icon.png]]

Revision as of 16:31, 7 January 2022

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 Pack

BASICIO

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


Downloadable macro reference

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


BuzzerOnDelay
Switch the Buzzer on for a fixed amount of time 
- UINT Time
Time in milliseconds to keep the buzzer on 
- UINT Frequency
Frequency to output in Hz 
- VOID Return



Property reference

Properties
Output Pin
Pin used to drive the output to the buzzer 
Connections
Simulations