精品导航

Buzz around!

Buzz around!

Let's learn what to do with the buzzer soldered to your CircuitPet.

As the word itself says, the buzzer is used to make buzzing sounds. 
We'll make a very similar sketch to the last one, but this time, pressing the buttons will trigger a particular sound to come out of the buzzer.


Let's start!

To begin with, let's write the instructions text that will appear on the screen once the code is executed.

The process is the as in the previous example.



Now that we've created a font let's change what happens with the buzzer when a specific button is pressed or released.
As in the previous sketch, we'll use I/O blocks to determine what happens when specific buttons are pressed.



Let us introduce you to a new block called "Play tone with frequency 100 Hz for 150 milliseconds".

Let's clear the display in purple once we press the A button.


You can choose what will be written on the display once the button is pressed.


For example, the screen can say "buzz" when we press the button.
Don't forget about the coordinates!

Let's make "x" 65 and "y" 60.
And for the end, drag the "push frame" block for a sketch to work.
First button - DONE!
Since we'll need the same blocks, we can easily duplicate them.
Let's do one button at a time.
The first one we'll do is for when a B button gets pressed. We decided to play tone with a frequency of 3000 Hz this time, and change the time to 50 ms.


The screen's color stays purple, but we'll print "Ding" this time.
Let's duplicate the block again.
Now, we'll use a right button for playing tone with a frequency of 1000 Hz for 200 milliseconds.
In the meantime, on the screen will be written "Boop". Note that we kept coordinations the same for all prints.


Yes, you guessed it right!
It's time to duplicate some more blocks.
The last button we'll use is the left one.
If you press the left button, the buzzer will play tone with a frequency of 2000 Hz for 200 milliseconds.
While the tone is playing, the screen will say "Beep".


Great! We used all of the four buttons from CircuitPet.
As always, don't forget to use the "loop forever" and "scan buttons".


Click on the Run button and hear those sounds!

友情链接:久久久久久 | 蘑菇tv网页版 | 蘑菇网页版入口 | 蜜芽视频 | mogu视频 | tissu-premier.com | 蘑菇视频ios | 青草草 | 蘑菇視頻 | 宅男影院 | 蘑菇视频入口 | 导航大全 | mogus.cc | 红桃视频 | 精品免费 | 玖玖爱 | 久久香蕉 | gzdksw.com | 蘑菇网 | 看片神器 | dk99999.com | 色啪 | 久久爱 | 青草青青 | fltou.com | 樱花视频 | 摩天轮社区 | 永久地址 | 天堂在线 | 六月婷婷 | mogu | bt搜索 | 综合影院 | 蘑菇短视频入口 | 蓝色导航 | 秋霞影院 | 亚洲网 | 屁屁影院 | 超碰视频 | 在线午夜 | 午夜在线观看 | hebeijiaoyuwang.com | tsxhyq.com | 五福影院 | 蘑菇传媒 | 青青伊人 | zhuoyemall.com | 草莓视 | btupic.com | 龙物视频 | 日本高清 | 第一福利 | 4008108885.com | dna0126.com | 蘑菇影视 | 无名网 | 酒色世界 | 福利精品 | 秋霞网 | 玖玖资源站 | 番号网 | rencai98.com | 小草社区 | 协和影院 | 青娱 | 扒哥黑料 | 性知音 | 久久视频 | 小蓝视频 | 天天综合 | 亚洲精品 | 蘑菇传媒在线观看 | 福利盒子 | sanzhucare-zhpg.com | 汤姆影院 | 迷妹网 | 老王影院 | 最新av | mogutv | jxty00.com | 欧美午夜 | 色婷婷 | 四虎影视 | 琳琅导航 | 伊人色 | 蘑菇视频网站 | zpzb2008.com | woqidz.com | 资源导航 | 琵琶妞 | 色妞 | 永久网站 | 在线亚洲 | 蘑菇在线观看网页版 | 五月丁香 | 蘑菇app | 老司机视频 | lf397.com | p站视频