Component: Piezo Sounder (Outputs: General)

From Flowcode Help
Jump to navigationJump to search


Author Matrix TSL
Version 1.0 (Release)
Category Outputs: General


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

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.