28123 Parallax Inc, 28123 Datasheet - Page 240

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
' What's a Microcontroller - TwinkleTwinkle.bs2
' Play the first seven notes from Twinkle Twinkle Little Star.
'{$STAMP BS2}
'{$PBASIC 2.5}
Notes
Frequencies
Durations
index
noteLetter
noteFreq
noteDuration
DEBUG
FOR index = 0 TO 6
NEXT
END
Your Turn – Adding and Playing More Notes
This program played the first seven notes from Twinkle Twinkle Little Star. The words
go “Twin-kle twin-kle lit-tle star”. The next phrase from the song goes “How I won-der
READ Notes + index, noteLetter
DEBUG "
READ Durations + (index * 2), Word noteDuration
DEBUG "
READ Frequencies + (index * 2), Word noteFreq
DEBUG "
FREQOUT 9, noteDuration, noteFreq
"Note
"----
Verify that the notes sound like the song Twinkle Twinkle Little Star.
Use the Debug Terminal to verify that it works as expected by accessing and
displaying values from the three
", noteLetter
", DEC4 noteDuration
Duration
--------
", DEC4 noteFreq, CR
DATA
DATA
DATA
VAR
VAR
VAR
VAR
"C","C","G","G","A","A","G"
Word 2093, Word 2093, Word 3136, Word 3136,
Word 3520, Word 3520, Word 3136
Word 500, Word 500, Word 500, Word 500,
Word 500, Word 500, Word 1000
Nib
Byte
Word
Word
Frequency", CR,
---------", CR
DATA
directives.

Related parts for 28123