Difference between revisions of "Component: Piezo Sounder (Outputs: General)"
(XML import BR) |
|||
Line 21: | Line 21: | ||
==Examples== | ==Examples== | ||
− | |||
Here is a simple example that will create a siren effect using a piezo sounder. | Here is a simple example that will create a siren effect using a piezo sounder. | ||
− | |||
{{Fcfile|PiezoSiren.fcfx|Piezo Siren}} | {{Fcfile|PiezoSiren.fcfx|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. | Depending on your Piezo Sounder you may need to amplify the signal from the microcontroller using a NPN transistor or N channel FET. | ||
[[File:BuzzerWire.jpg]] | [[File:BuzzerWire.jpg]] | ||
− | |||
==Downloadable macro reference== | ==Downloadable macro reference== |
Latest revision as of 15:46, 16 February 2017
Author | Matrix TSL |
Version | 1.0 (Release) |
Category | Outputs: General |
Contents
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.
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
Parameters
- 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
Return value
- This call does not return a value
BuzzerOnDelay
Switch the Buzzer on for a fixed amount of time
Parameters
- UINT Time
- Time in milliseconds to keep the buzzer on
- UINT Frequency
- Frequency to output in Hz
Return value
- This call does not return a value
Simulation macro reference
This component does not contain any simulation macros
Property reference
Output Pin
This property is of type Single digital pin and can be referenced with the variable name pin.
Pin used to drive the output to the buzzer
Color
This property is of type Color picker and can be referenced with the variable name Color.
Controls the color of the Buzzer object on the panel.