28123 Parallax Inc, 28123 Datasheet - Page 234

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
Example Program: MixingTones.bs2
This example program demonstrates the difference in tone that you get when you mix 2
and 3 kHz together. It also demonstrates an interesting phenomenon that occurs when
you mix two sound waves that are very close in frequency. When you mix 2000 Hz with
2001 Hz, the tone will fade in and out once every second (at a frequency of 1 Hz). If you
mix 2000 Hz with 2002 Hz, it will fade in and out twice a second (2 Hz), and so on.
' What's a Microcontroller - MixingTones.bs2
' Demonstrate some of the things that happen when you mix two tones.
'{$STAMP BS2}
'{$PBASIC 2.5}
DEBUG "Frequency = 2000", CR
FREQOUT 9, 4000, 2000
DEBUG "Frequency = 3000", CR
FREQOUT 9, 4000, 3000
DEBUG "Frequency = 2000 + 3000", CR
FREQOUT 9, 4000, 2000, 3000
DEBUG "Frequency = 2000 + 2001", CR
Enter and run MixingTones.bs2.
Keep an eye on the Debug Terminal as the tones play, and note the different
effects that come from mixing the different tones.
Each touchtone keypad tone is also an example of two frequencies mixed together. In
telecommunications, that is called DTMF (Dual Tone Multi Frequency). There is also a
PBASIC command called
examples of projects where phone numbers are dialed, see the
BASIC Stamp Manual.
Beat is when two tones very close in frequency are played together causing the tone you
hear to fade in and out. The frequency of that fading in and out is the difference between
the two frequencies. If the difference is 1 Hz, the tone will fade in and out at 1 Hz. If the
difference is 2 Hz, the tone will fade in and out at 2 Hz.
The variations in air pressure made by the piezoelectric speaker are called sound waves.
When the tone is loudest, the variations in air pressure caused by the two frequencies are
adding to each other (called superposition). When the tone is at its quietest, the variations
in air pressure are canceling each other out (called interference).
DTMFOUT
that is designed just for sending phone tones. For
DTMFOUT
command in the

Related parts for 28123