28129 Parallax Inc, 28129 Datasheet - Page 111

TEXT BASIC ANALOG & DIGITAL

28129

Manufacturer Part Number
28129
Description
TEXT BASIC ANALOG & DIGITAL
Manufacturer
Parallax Inc
Type
Programmingr
Datasheet

Specifications of 28129

Style
Book
Title
Basic Analog and Digital
Contents
Basic Analog and Digital Text
Product
Microcontroller Accessories
Lead Free Status / RoHS Status
Not applicable / Not applicable
shown in Figure 5-6. These three circuit elements are all that's necessary to connect to the
BASIC Stamp to play tunes and tones.
The piezoelectric speaker shown in Figure 5-6 works like a rechargeable battery that
charges and discharges over short periods of time. By applying lots of pulses to the
circuit, the voltage output can actually be shaped into a signal.
These pulses can be varied in width and applied more or less frequently. Depending on
the pulse widths and frequencies, the capacitance of the piezospeakers gains or loses
voltage at varying rates. That's the gist of how pulse width modulation (PWM) works,
and it can be used to shape voltage signals. Figure 5-7 shows a sample of a PWM signal
applied to the input of an RC circuit as well as a sine wave output.
Sine waves can be used to represent musical notes. When a sine wave is played on the
piezoelectric speaker, the sound has a significantly improved quality. The variations in air
pressure caused by a tuning fork are represented by a sine wave. Program Listing 5.3
PWM Signal
P10
Vss
Sine Wave
Figure 5-6
BASIC Stamp Music
Circuit
Figure 5-7
Oscilloscope
Samples
Of a PWM
signal and a
sine wave.

Related parts for 28129