28122 Parallax Inc, 28122 Datasheet - Page 240

KIT WHAT'S A MICRO:PARTS ONLY

28122

Manufacturer Part Number
28122
Description
KIT WHAT'S A MICRO:PARTS ONLY
Manufacturer
Parallax Inc
Datasheet

Specifications of 28122

Accessory Type
Parts Kit
Product
Microcontroller Accessories
Core Processor
PIC16C57c
Flash
128 Bytes
Operating Supply Voltage
9 V
Board Size
31 mm x 16 mm
For Use With/related Products
Board of Education Full Kit
Lead Free Status / RoHS Status
Lead free / RoHS Compliant
' 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 28122