Difference between revisions of "Component: Buzzer (Audio Output)"

From Flowcode Help
Jump to navigationJump to search
 
(2 intermediate revisions by 2 users not shown)
Line 14: Line 14:
 
==Buzzer component==
 
==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.
 
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 Pack==
 +
 +
BASICIO
  
 
==Detailed description==
 
==Detailed description==
 +
 +
 +
 +
  
  
Line 26: Line 34:
  
 
==Examples==
 
==Examples==
 +
 +
 +
 +
  
  
Line 38: Line 50:
  
 
[[File:BuzzerWire.jpg]]
 
[[File:BuzzerWire.jpg]]
 +
 +
 +
 +
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
 +
 +
{{Fcfile|Basic Buzzer Example.fcfx|Basic Buzzer Example}}
  
 
==Downloadable macro reference==
 
==Downloadable macro reference==
Line 142: Line 168:
 
|-
 
|-
 
| colspan="2" | Frequency of the buzzer in Hz to drive the simulation 
 
| colspan="2" | Frequency of the buzzer in Hz to drive the simulation 
|-
 
| 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 17:27, 9 November 2022

Author Matrix TSL
Version 1.0
Category Audio Output


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 Pack

BASICIO

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.


BuzzerWire.jpg


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

FC6 Icon.png Basic Buzzer Example

Downloadable macro reference

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-void-icon.png - VOID Return


Fc9-comp-macro.png BuzzerOff
Switch Off the Buzzer 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png BuzzerOn
Switch On the Buzzer 
Fc9-void-icon.png - VOID Return


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-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 
Fc9-type-16-icon.png Polarity
Controls the pin state required to switch the buzzer on. 
Fc9-type-1-icon.png Color
Controls the color of the Buzzer object on the panel. 
Fc9-type-21-icon.png Buzzer Frequency
Frequency of the buzzer in Hz to drive the simulation