28123 Parallax Inc, 28123 Datasheet - Page 233

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
DEBUG "Hyperspace...", CR
DEBUG "Done", CR
END
Your Turn – More Sound Effects
There is pretty much an endless number of ways to modify ActionTones.bs2 to get
different sound combinations. Here is just one modification to the “Hyperspace” routine:
Two Frequencies at Once
You can send two frequencies at the same time. In audio, this is called “mixing”.
Remember the
You can use the optional
command. For example, you can mix 2 and 3 kHz together like this:
PAUSE 100
FOR duration = 15 TO 1 STEP 1
NEXT
FREQOUT 9, 200, 2400
FREQOUT 9, 140, 4200
FREQOUT 9,
PAUSE 500
FOR frequency = 2000 TO 2500 STEP 20
NEXT
FREQOUT 9, duration, frequency
DEBUG "Hyperspace jump...", CR
FREQOUT Pin, Duration, Freq1 {, Freq2}
FREQOUT 9, 1000, 2000, 3000
Save your example program under the name ActionTonesYourTurn.bs2.
Have fun with this and other modifications of your own invention.
FOR duration = 15 TO 1 STEP 3
NEXT
FOR duration = 1 TO 36 STEP 3
NEXT
FOR frequency = 2000 TO 2500 STEP 15
NEXT
FOR frequency = 2500 TO 2000 STEP 15
NEXT
FREQOUT
FREQOUT 9, duration, frequency
FREQOUT 9, duration, frequency
30, 2000
command’s syntax from Activity #1:
Freq2
argument to mix two frequencies using the
FREQOUT

Related parts for 28123