28123 Parallax Inc, 28123 Datasheet - Page 245

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
The note’s frequency has been determined, but the duration still has to be figured out.
The
into
Then,
noteDuration
÷ 4 = 500. If
Now that
note.
Each time through the main loop, the
main loop gets back to the beginning, the first thing the program does is read the next
note, using the
Your Turn – Experimenting with Tempo and a Different Tune
The length of time that each note lasts is related to the tempo. You can change the tempo
by adjusting the
and the song will play slower. If you increase it to 1750, the tempo will increase and the
song will play more quickly.
Entering musical data is much easier when all you have to do is record notes and
durations. Here are the first eight notes from Beethoven’s Fifth Symphony.
noteDuration
READ
noteDuration
LOOP
noteDuration
command uses the value of
Save
NotesAndDurationsYourTurn.bs2.
Modify the tempo of NotesAndDurationsYourTurn.bs2 by adjusting the value
of
Re-run the program after each modification, and decide which one sounds
best.
READ Durations + index, noteDuration
noteDuration = WholeNote / noteDuration
FREQOUT 9, noteDuration, noteFreq
index = index + 1
WholeNote
noteDuration
index
. If note duration starts out as 4 from a
WholeNote
.
variable.
NotesAndDurations.bs2
is set equal to the
. Try values of 1500, 1750, 2000, and 2250.
and
constant. If you increase it to 2250, the tempo will decrease,
is 8, it becomes 1500 ÷ 8 = 250.
noteFreq
index
index
2349, 2489, 2637, 2794, 2960,
3136, 3322,
are determined, the
to place a value from the
value must be increased by one. When the
WholeNote
READ
under
0,
FREQOUT
command, it becomes 2000
constant divided by the
0
], noteFreq
command plays the
Durations DATA
the
name

Related parts for 28123