Difference between revisions of "Buzzer (use with mDesigner)"
(→Issues) |
(→Buzzer - Play Song) |
||
(13 intermediate revisions by the same user not shown) | |||
Line 100: | Line 100: | ||
<br style="clear: left;" /> | <br style="clear: left;" /> | ||
</div> | </div> | ||
+ | |||
+ | =Blocks= | ||
+ | |||
+ | ==Buzzer - Set Frequency== | ||
+ | This block sets the Buzzer to produce a sound at the desired frequency (Hz) for the set duration (milliseconds).<br>If the duration is set to 0, then the Buzzer will continuously be active until a '''Buzzer - Off''' block is encountered. | ||
+ | {| class="wikitable" style="background-color:#FEF9E7;" | ||
+ | |'''Note:''' If the duration is set (not 0) this block is holding. Which means the frequency must complete playing before the program goes to the next block in the script. | ||
+ | |} | ||
+ | ::[[File:MDesigner Buzzer Set Frequency.png]] | ||
+ | :*'''Pin Number'''- the pin the Buzzer is connected to. | ||
+ | :*'''Frequency''' - the frequency (in Hz) to set the Buzzer to. | ||
+ | :*'''Duration''' - the duration (in '''milliseconds''') to play the frequency for. | ||
+ | |||
+ | ==Buzzer - Play Note== | ||
+ | This block sets the Buzzer to play a note for the set duration (seconds).<br>If the duration is set to 0, then the Buzzer will continuously be active until a '''Buzzer - Off''' block is encountered. | ||
+ | {| class="wikitable" style="background-color:#FEF9E7;" | ||
+ | |'''Note:''' If the duration (seconds) is set (not 0) this block is holding. Which means the note must complete playing before the program goes to the next block in the script. | ||
+ | |} | ||
+ | ::[[File:MDesigner Buzzer Play Note.png]] | ||
+ | :*'''Pin Number''' - the pin the Buzzer is connected to. | ||
+ | :*'''Note''' - the note to play. | ||
+ | :*'''Duration''' - the duration (in '''seconds''') to play the note for. | ||
+ | |||
+ | ==Buzzer - Play Song== | ||
+ | This block sets the Buzzer to play a song from the drop down list. | ||
+ | {| class="wikitable" style="background-color:#FEF9E7;" | ||
+ | |'''Note:''' This block is holding. Which means the song must complete playing before the program goes to the next block in the script. | ||
+ | |} | ||
+ | ::[[File:MDesigner Buzzer Play Song.png]] | ||
+ | :*'''Pin Number''' - the pin the Buzzer is connected to. | ||
+ | :*'''Song''' - song selection to play. | ||
+ | |||
+ | ==Buzzer - Off== | ||
+ | This block turns off the Buzzer. | ||
+ | ::[[File:MDesigner Buzzer Off.png]] | ||
+ | |||
=Issues= | =Issues= | ||
The Buzzer trinket utilizes a resource called a timer. This can cause issues with analog write (PWM), the IR Receiver, and other functions. Undesired or unintended behavior can occur when this timer resource is being accessed by different things at the same time. | The Buzzer trinket utilizes a resource called a timer. This can cause issues with analog write (PWM), the IR Receiver, and other functions. Undesired or unintended behavior can occur when this timer resource is being accessed by different things at the same time. | ||
− | |||
− |
Latest revision as of 17:21, 8 June 2018
The Buzzer is a sound producing trinket which vibrates to produce sounds. Support for this trinket is found in mDesigner.
Contents
Compatible Pins
The following pins on the Hub or mCenter+'s Hub support this module:
Pin Name | Compatibility | Notes |
---|---|---|
Pin 0 | Yes | Not recommended, Pin 0 & 1 used by mDesigner (serial communication). |
Pin 1 | Yes | Not recommended, Pin 0 & 1 used by mDesigner (serial communication). |
Pin 2 | Yes | |
Pin 3 | Yes | |
Pin 4 | Yes | |
Pin 5 | Yes | |
Pin 6 | Yes | |
Pin 7 | Yes | |
Pin 8 | Yes | |
Pin 9 | Yes | |
Pin 10 | Yes | |
Pin 11 | Yes | |
Pin 12 | Yes | |
Pin 13 | Yes | |
Pin A0 | Yes | |
Pin A1 | Yes | |
Pin A2 | Yes | |
Pin A3 | Yes | |
Pin A6 | Yes | |
Pin A7 | Yes | |
Pin I2C | No |
Blocks
Buzzer - Set Frequency
This block sets the Buzzer to produce a sound at the desired frequency (Hz) for the set duration (milliseconds).
If the duration is set to 0, then the Buzzer will continuously be active until a Buzzer - Off block is encountered.
Note: If the duration is set (not 0) this block is holding. Which means the frequency must complete playing before the program goes to the next block in the script. |
-
- Pin Number- the pin the Buzzer is connected to.
- Frequency - the frequency (in Hz) to set the Buzzer to.
- Duration - the duration (in milliseconds) to play the frequency for.
Buzzer - Play Note
This block sets the Buzzer to play a note for the set duration (seconds).
If the duration is set to 0, then the Buzzer will continuously be active until a Buzzer - Off block is encountered.
Note: If the duration (seconds) is set (not 0) this block is holding. Which means the note must complete playing before the program goes to the next block in the script. |
-
- Pin Number - the pin the Buzzer is connected to.
- Note - the note to play.
- Duration - the duration (in seconds) to play the note for.
Buzzer - Play Song
This block sets the Buzzer to play a song from the drop down list.
Note: This block is holding. Which means the song must complete playing before the program goes to the next block in the script. |
Buzzer - Off
This block turns off the Buzzer.
Issues
The Buzzer trinket utilizes a resource called a timer. This can cause issues with analog write (PWM), the IR Receiver, and other functions. Undesired or unintended behavior can occur when this timer resource is being accessed by different things at the same time.