28122 Parallax Inc, 28122 Datasheet - Page 232

KIT WHAT'S A MICRO:PARTS ONLY

28122

Manufacturer Part Number
28122
Description
KIT WHAT'S A MICRO:PARTS ONLY
Manufacturer
Parallax Inc
Datasheet

Specifications of 28122

Accessory Type
Parts Kit
Product
Microcontroller Accessories
Core Processor
PIC16C57c
Flash
128 Bytes
Operating Supply Voltage
9 V
Board Size
31 mm x 16 mm
For Use With/related Products
Board of Education Full Kit
Lead Free Status / RoHS Status
Lead free / RoHS Compliant
duration
frequencies of 2000, then 2020, then 2040, and so on, up through 2500 to the piezo
speaker. When the frequency loop is finished, the
of its 15 passes. So it subtracts one from the value of
frequency
Example Program: NestedLoops.bs2
To better understand how nested
command to show the value of a much less complicated version of the nested loop used
in ActionTones.bs2.
' What's a Microcontroller - ActionTones.bs2
' Demonstrate how different combinations of pause, duration, and frequency
' can be used to make sound effects.
'{$STAMP BS2}
'{$PBASIC 2.5}
duration
frequency
DEBUG "Alarm...", CR
DEBUG "Robot reply...", CR
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
Enter and run NestedLoops.bs2.
Examine the Debug Terminal output and verify how the duration and
frequency arguments change each time through the loop.
FOR duration = 15 TO 1
NEXT
variable starts at 15, then the
loop all over again.
FOR frequency = 2000 TO 2500 STEP 15
NEXT
FREQOUT 9, duration, frequency
VAR
VAR
Word
Word
FOR…NEXT
loops work, NestedLoops.bs2 uses the
frequency
duration
loop takes over and sends
duration
loop has only repeated one
and repeats the
DEBUG

Related parts for 28122