28129 Parallax Inc, 28129 Datasheet - Page 109

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
Enter this program into the BASIC Stamp Editor. This is not a modification to the
previous programs. Also, the output is the piezoelectric speaker and there is no Debug
Terminal output. Save this program as P5_2RO.bs2.
' Basic Analog and Digital - PL5_2R0.bs2
' D/A Converter Making Sound, n changes volume, m changes frequency
' {$STAMP BS2}
' {$PBASIC 2.5}
n
m
DIRB=15
n = 15
m = 500
DAC:
GOTO DAC
P7
P6
P5
P4
OUTB = n
PAUSE m
OUTB = 0
PAUSE m
VAR
VAR
2 k
2 k
2 k
2 k
Nib
Word
Vss
1 k
1 k
1 k
2 k
LM358
2 k
Vdd
Vss
A
Vss
Figure 5-5
Piezoelectric Speaker Circuit
Connected to the buffered output
of the D/A converter.

Related parts for 28129