28123 Parallax Inc, 28123 Datasheet - Page 230

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
Your Turn – Adjusting Frequency and Duration
ACTIVITY #2: ACTION SOUNDS
Many toys contain microcontrollers that are used to make action sounds. Action sounds
tend to involve rapidly changing the frequency played by the speaker. You can also get
some interesting effects from mixing two different tones together using the
command’s optional
Programming Action Sounds
Action and appliance sounds have three different components:
The pause is the time between tones, and you can use the
pause. The duration is the amount of time a tone lasts, which you can set using the
FREQOUT
tone. The higher the frequency, the higher the pitch, the lower the frequency, the lower
the pitch. This is, of course, determined by the
Example Program: ActionTones.bs2
ActionTones.bs2 demonstrates a few different combinations of pause, duration, and
frequency. The first sequence of tones sounds similar to an electronic alarm clock. The
second one sounds similar to something a familiar science fiction movie robot might say.
The third is more the kind of sound effect you might hear in an old video game.
' What's a Microcontroller - ActionTones.bs2
' Demonstrate how different combinations of pause, duration, and frequency
' can be used to make sound effects.
1. Pause
2. Duration
3. Frequency
command’s
Save TestPiezoWithFreqout.bs2 under a different name.
Try some different values for the
After each change, run the program and make a note of the effect.
As the
values of 1500, 2000, 2500 and 3000 to answer this question.
Enter and run ActionTones.bs2.
Freq1
Freq2
Duration
argument gets larger, does the tone’s pitch go up or down? Try
argument. This activity introduces both techniques.
argument. The frequency determines the pitch of the
Duration
FREQOUT
and
command’s
PAUSE
Freq1
command to create that
argument.
Freq1
argument.
FREQOUT

Related parts for 28123