Sound is used very often in hardware programming; it is also a direct way of feedback. This article will introduce the buzzer of Future board thoroughly and teach you how to program them with Kittenblock and to have more fun with it.
Â
Programming Blocks
Block |
Introduction |
The buzzer plays for a period of time at a certain frequency Different frequencies correspond to different keys/tones |
|
The buzzer plays constantly at a certain frequency |
|
Map the frequency to the corresponding octave, it will make it easier to use |
|
Pause for a period of time according to the beats ( equivalent to delaying) Depends on bpm. When it is default bpm125, 1 beat equals 0.5 seconds |
|
Play the custom melody |
|
Play the melody in the system |
|
Beats per minute, which equals the playing speed |
|
stop playing, normally used in combination with keep playing block |
Â
Â
Example
📋:Buzzer frequency sounds
Â
📋:Buzzer frequency keep making sounds
suitable for making instrument(piano) project
Â
📋:Buzzer plays according to the notes
Play all the notes within the octave
Â
📋:Play the melody
- Take c4:2 as an example:
- c: Represent notes from do to ti. An octave includes 7 notes, which are c, d, e, f, g, a, and b.
- 4: the octave, for example, 4 is the fourth octave.
- :2: Duration. Take the default situation as an example, when bpm=120 and the quarter note as one beat, 2 beats per second => 0.5 sec/beat, 2 represents half of the quarter note, so the duration of c4:2 is 0.25 seconds.
Â
📋:Play the built-in melody
Â
📋:Change the bpm of the melody
Â
If you have any question, please feel free to contact us at Discord, we will always be there to help.
Â
KittenBot Team