BASIC stamp manual v2.2
SOUND – BASIC Stamp Command Reference
Page 446 • BASIC Stamp Syntax and Reference Manual 2.2 • www.parallax.com
from I/O pin
1k
0.1
µ
F0.01
µ
F
1k
Driving an Audio Amplifier
Amplifier
(e
.g., Radio Shack
277-1008C)
Vss Vss Vss
10
µ
F (both)
+
+
≥
40
Ω
Speaker
(or 8
Ω
in series
with 33
Ω
resistor)
from I/O pin
C1 C2
Notes:
C1 may be omitted for piezo speakers
C2 is optional, but reduces high-frequency noise
Driving a Speaker
Vss Vss
Figure 5.46: Example RC filter
circuits for driving an audio amplifier
(top) or a speaker(bottom).
Demo Program (SOUND.bs1)
' SOUND.bs1
' This program generates a constant tone 25 followed by an ascending tones.
' Both the tones have the same duration.
' {$STAMP BS1}
' {$PBASIC 1.0}
SYMBOL tone = B2
Main:
FOR tone = 0 TO 255
SOUND 0, (25, 10, tone, 10)
NEXT
END
1