1
SKILL
LEVEL
Ringo Educational Guide Rev04.1 ~ Plum Geek
Chirps, Zips, and Pings! Sound!
Ringo can make simple sounds with a piece of hardware called a
piezo. The piezo is similar to speaker, and can be used to create
tones.
Causing Ringo to emit a tone from his piezo is super easy. Just
use the
PlayChirp()
function. The PlayChirp function takes two
arguments. Arguments are bits of information you pass into a function when it is
run. You did this with the pixel and motor functions in the previous example and
didn’t even realize it. :-)
Let’s look at an example:
PlayChirp(Frequency, Amplitude);
You pass a frequency, which is the pitch of the tone to be played in hertz.
Amplitude is a variable that controls the overall tonal quality and loudness. An
amplitude of about 50 results in the loudest tone for most pitches. Normally you’ll
pass the amplitude as 50, but you can experiment with this number a bit to see
what happens. Usually, amplitudes greater than 50 will result in more current being
used (shorter battery life) without really making the piezo much louder.
This is Ringo’s Piezo Element
(It is tucked under the battery)