Difference between revisions of "Itty Bitty Buggy: Buzzer Tutorial (mDesigner)"
(→Example 2: Play a note, pause, play another note, pause, repeat) |
(→Block: Off) |
||
(21 intermediate revisions by the same user not shown) | |||
Line 68: | Line 68: | ||
|bgcolor=FEC254|Events | |bgcolor=FEC254|Events | ||
|[[File:MDesigner_When_Click_Green_Flag_block_new.png|x50px]] [[File:Info_icon.png|24px|link=block_reference]] | |[[File:MDesigner_When_Click_Green_Flag_block_new.png|x50px]] [[File:Info_icon.png|24px|link=block_reference]] | ||
+ | |- | ||
+ | |bgcolor=FEAD50|Control | ||
+ | | | ||
+ | [[File:mDesigner_v1.6_Wait_block.png|x50px]] [[File:Info_icon.png|24px|link=block_reference]]<br><br> | ||
+ | [[File:mDesigner_v1.6_Forever_block.png|x75px]] [[File:Info_icon.png|24px|link=block_reference]] | ||
|- | |- | ||
|Buggy [[File:IBB_Buggy_icon.png|x30px]] | |Buggy [[File:IBB_Buggy_icon.png|x30px]] | ||
Line 84: | Line 89: | ||
'''Description:''' [[how to activate blocks|When activated]], Buzzer repeatedly play note C4 (1 second), pause (1 second), play note D4 (1 second), pause (1 second). | '''Description:''' [[how to activate blocks|When activated]], Buzzer repeatedly play note C4 (1 second), pause (1 second), play note D4 (1 second), pause (1 second). | ||
+ | |||
+ | =Block: Play Song= | ||
+ | Buzzer can be controlled to play a note with the '''Buzzer - Play Note''' block. | ||
+ | {| class="wikitable" | ||
+ | | | ||
+ | '''Function:''' This block controls the Buzzer to play the selected song. | ||
+ | {| class="wikitable" style="background-color:#FF0000; color:#FFFFFF" | ||
+ | |'''Note:''' This block's behavior is '''DIFFERENT''' between online and offline mode! | ||
+ | |} | ||
+ | {| class="wikitable" style="background-color:#FEF9E7;" | ||
+ | |'''Note:''' As of mDesigner v1.6: | ||
+ | *In "online mode" this block is holding. Which means the song must complete playing before the program goes to the next block in the script. | ||
+ | *In "offline mode" this block must be constantly called in order to play each note of the song. A '''Forever''' or '''Repeat''' block should be used. | ||
+ | |} | ||
+ | :[[File:IBB mDesigner Buzzer Block Play Song.png]] | ||
+ | |||
+ | :*'''Song''' - selected song to play. | ||
+ | |} | ||
+ | |||
+ | ==Example 3a: Play a song with Buzzer (Online Mode)== | ||
+ | {| class="wikitable" style="background-color:#FEF9E7;" | ||
+ | |'''Note:''' this example is performed in '''online mode''' ONLY.<br> | ||
+ | If you have overwritten the firmware when using "offline mode", [[Itty_Bitty_Buggy:_Getting_Started_(mDesigner)#Connecting_to_Itty_Bitty_Buggy_to_mDesigner_.28Online_mode.29|'''please follow the instructions to reset back to "online mode"'''.]] | ||
+ | |} | ||
+ | {| | ||
+ | |style="vertical-align:top;"| | ||
+ | {| class="wikitable" | ||
+ | |+Blocks Used | ||
+ | !Block Category | ||
+ | !Blocks | ||
+ | |- | ||
+ | |bgcolor=FEC254|Events | ||
+ | |[[File:MDesigner_When_Click_Green_Flag_block_new.png|x50px]] [[File:Info_icon.png|24px|link=block_reference]] | ||
+ | |- | ||
+ | |Buggy [[File:IBB_Buggy_icon.png|x30px]] | ||
+ | |[[File:IBB_mDesigner_Buzzer_Block_Play_Song_NoLabels.png|x50px|link=Buggy_Base_(use_with_mDesigner)#Buzzer_-_Play_Song]] [[File:Info_icon.png|24px|link=Buggy_Base_(use_with_mDesigner)#Buzzer_-_Play_Song]] | ||
+ | |} | ||
+ | |||
+ | |style="vertical-align:top;"| | ||
+ | {| class="wikitable" | ||
+ | |+Example | ||
+ | |- | ||
+ | |style="padding:50px;"| | ||
+ | [[File:IBB_mDesigner_Buzzer_Example3a.png]] | ||
+ | |} | ||
+ | |||
+ | |} | ||
+ | |||
+ | '''Description:''' [[how to activate blocks|When activated]], Buzzer will play the selected song. | ||
+ | |||
+ | |||
+ | ==Example 3b: Play a song with Buzzer (Offline Mode)== | ||
+ | {| class="wikitable" style="background-color:#FEF9E7;" | ||
+ | |'''Note:''' this example is performed in '''offline mode''' ONLY! [[File:Info_icon.png|24px|link=no_link]]<br> | ||
+ | |} | ||
+ | {| | ||
+ | |style="vertical-align:top;"| | ||
+ | {| class="wikitable" | ||
+ | |+Blocks Used | ||
+ | !Block Category | ||
+ | !Blocks | ||
+ | |- | ||
+ | |bgcolor=FEC254|Events | ||
+ | |[[File:MDesigner_When_Click_Green_Flag_block_new.png|x50px]] [[File:Info_icon.png|24px|link=block_reference]] | ||
+ | |- | ||
+ | |bgcolor=FEAD50|Control | ||
+ | | | ||
+ | [[File:mDesigner_v1.6_Wait_block.png|x50px]] [[File:Info_icon.png|24px|link=block_reference]]<br><br> | ||
+ | [[File:MDesigner_v1.6_Repeat_block.png|x75px]] [[File:Info_icon.png|24px|link=block_reference]]<br><br> | ||
+ | |- | ||
+ | |Buggy [[File:IBB_Buggy_icon.png|x30px]] | ||
+ | | | ||
+ | [[File:IBB_mDesigner_Buzzer_Block_Play_Song_NoLabels.png|x50px|link=Buggy_Base_(use_with_mDesigner)#Buzzer_-_Play_Song]] [[File:Info_icon.png|24px|link=Buggy_Base_(use_with_mDesigner)#Buzzer_-_Play_Song]]<br><br> | ||
+ | [[File:IBB_mDesigner_Buzzer_Block_Off.png|x50px|link=Buggy_Base_(use_with_mDesigner)#Buzzer_-_Off]] [[File:Info_icon.png|24px|link=Buggy_Base_(use_with_mDesigner)#Buzzer_-_Off]] | ||
+ | |} | ||
+ | |||
+ | |style="vertical-align:top;"| | ||
+ | {| class="wikitable" | ||
+ | |+Example | ||
+ | |- | ||
+ | |style="padding:50px;"| | ||
+ | [[File:IBB_mDesigner_Buzzer_Example3b.png]] | ||
+ | |} | ||
+ | |||
+ | |} | ||
+ | |||
+ | '''Description:''' [[how to activate blocks|When activated]], this program repeatedly calls the '''Buzzer - Play Song''' block in order to play notes using the '''Repeat''' block. The amount of time allocated to play the song is calculated by the 0.02 second wait times the number of repeats 400. 0.02 second * 400 = 8 seconds. The '''Buzzer - Off''' block MUST be called in order to stop the Buzzer. | ||
+ | |||
+ | =Block: Off= | ||
+ | This block turns off the Buzzer. It is only useful to use in certain situations such as demonstrated in '''[[#Example 3b: Play a song with Buzzer (Offline Mode)]]'''. | ||
+ | |||
+ | {| class="wikitable" | ||
+ | | | ||
+ | {| class="wikitable" style="background-color:#FEF9E7;" | ||
+ | |'''Note:''' As of mDesigner v1.6, this block has no intended purpose because the '''Buzzer - Play Note''' and '''Buzzer - Play Song''' blocks will stop automatically based on the duration.<br>It is only useful in certain situations such as demonstrated in '''[[#Example 3b: Play a song with Buzzer (Offline Mode)]]'''. | ||
+ | |} | ||
+ | '''Function:''' This block controls the Buzzer to stop producing sound. | ||
+ | |||
+ | :[[File:IBB_mDesigner_Buzzer_Block_Off.png]] | ||
+ | |} |
Latest revision as of 23:49, 1 November 2018
Contents
Buzzer
Buggy Base contains a Buzzer capable of producing sounds. When pulses of electricity are sent to the Buzzer, the pulses causes the Buzzer to vibrate and produce an audible sound. Pulses of different frequencies will cause the Buzzer to produce different notes. The following blocks will allow the user to control the Buzzer.
Block: Play Note
Buzzer can be controlled to play a note with the Buzzer - Play Note block.
Function: This block controls the Buzzer to play the selected note for the specified duration.
|
Example 1: Play a note with Buzzer
Note: this example can be performed in online or offline mode. If you plan to use online mode and previously used offline mode, please follow the instructions to reset back to "online mode". |
|
|
Description: When activated, Buzzer will play note C4 for 3 seconds.
Example 2: Play a note, pause, play another note, pause, repeat
Note: this example can be performed in online or offline mode. If you plan to use online mode and previously used offline mode, please follow the instructions to reset back to "online mode". |
|
|
Description: When activated, Buzzer repeatedly play note C4 (1 second), pause (1 second), play note D4 (1 second), pause (1 second).
Block: Play Song
Buzzer can be controlled to play a note with the Buzzer - Play Note block.
Function: This block controls the Buzzer to play the selected song.
|
Example 3a: Play a song with Buzzer (Online Mode)
Note: this example is performed in online mode ONLY. If you have overwritten the firmware when using "offline mode", please follow the instructions to reset back to "online mode". |
|
|
Description: When activated, Buzzer will play the selected song.
Example 3b: Play a song with Buzzer (Offline Mode)
Note: this example is performed in offline mode ONLY! |
|
|
Description: When activated, this program repeatedly calls the Buzzer - Play Song block in order to play notes using the Repeat block. The amount of time allocated to play the song is calculated by the 0.02 second wait times the number of repeats 400. 0.02 second * 400 = 8 seconds. The Buzzer - Off block MUST be called in order to stop the Buzzer.
Block: Off
This block turns off the Buzzer. It is only useful to use in certain situations such as demonstrated in #Example 3b: Play a song with Buzzer (Offline Mode).
Function: This block controls the Buzzer to stop producing sound. |