精品导航

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!

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