28123 Parallax Inc, 28123 Datasheet - Page 231

TEXT WHAT'S A MICROCONTROLLER

28123

Manufacturer Part Number
28123
Description
TEXT WHAT'S A MICROCONTROLLER
Manufacturer
Parallax Inc
Type
Programmingr
Datasheet

Specifications of 28123

Style
Book
Title
What's a Microcontroller?
Contents
Whats a Microcontroller? Text
Product
Microcontroller Accessories
Core Processor
PIC16C57c
Flash
128 Bytes
Operating Supply Voltage
9 V
Board Size
31 mm x 16 mm
Lead Free Status / RoHS Status
Not applicable / Not applicable
'{$STAMP BS2}
'{$PBASIC 2.5}
duration
frequency
DEBUG "Alarm...", CR
DEBUG "Robot reply...", CR
DEBUG "Hyperspace...", CR
DEBUG "Done", CR
END
How ActionTones.bs2 Works
The “Alarm” routine sounds like an alarm clock. This routine plays tones at a fixed
frequency of 1.5 kHz for a duration of 0.5 s with a fixed delay between tones of 0.5 s.
The “Robot reply” routine uses various frequencies for brief durations.
The “Hyperspace” routine uses no delay, but it varies both the duration and frequency.
By using
some interesting sound effects. When one
is called a nested loop. Here is how the nested
PAUSE 100
FOR duration = 15 TO 1 STEP 1
NEXT
PAUSE 100
FREQOUT 9, 500, 1500
PAUSE 500
FREQOUT 9, 500, 1500
PAUSE 500
FREQOUT 9, 500, 1500
PAUSE 500
FREQOUT 9, 500, 1500
PAUSE 500
PAUSE 100
FREQOUT 9, 100, 2800
FREQOUT 9, 200, 2400
FREQOUT 9, 140, 4200
FREQOUT 9,
PAUSE 500
FOR frequency = 2000 TO 2500 STEP 20
NEXT
FREQOUT 9, duration, frequency
FOR…NEXT
VAR
VAR
30, 2000
loops to rapidly change the frequency and duration, you can get
Word
Word
FOR…NEXT
FOR…NEXT
loop executes inside another one, it
loop shown below works. The

Related parts for 28123