28123 Parallax Inc, 28123 Datasheet - Page 259

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
Turn section. This program plays a tune called Reveille, which is the bugle call played at
military camps first thing in the morning. You may have heard it in any number of
movies or television shows.
Example Program: MicroMusicWithRtttl.bs2
This application program is pretty long, and it’s a good idea to download the latest
version from the
Look for a link named Selected Example Programs near the What’s a Microcontroller
PDF downloads. Downloading the program and opening it with the BASIC Stamp Editor
should save you a significant amount of time. The alternative, of course, is to hand enter
and debug four pages of code.
' What's a Microcontroller - MicroMusicWithRtttl.bs2
' Play Nokia RTTTL format ringtones using DATA.
'{$STAMP BS2}
'{$PBASIC 2.5}
DEBUG "Program Running!"
' -----[ I/O Definitions ]-------------------------------------------------
' -----[ Variables ]-------------------------------------------------------
RTTTL_File
SpeakerPin
counter
char
index
noteLetter
noteFreq
Use
MicroMusicWithRtttl.bs2 file, or hand enter the example below very carefully.
Run the program, and verify that the piece is recognizable as the Reveille
bugle call.
Go to the Your Turn section and try some more tunes (RTTTL_File DATA
directives).
the
www.parallax.com
DATA
CON
VAR
VAR
VAR
VAR
VAR
BASIC
"Reveille:d=4,o=7,b=140:8g6,8c,16e,16c,8g6,8e,",
"8c,16e,16c,8g6,8e,8c,16e,16c,8a6,8c,e,8c,8g6,",
"8c,16e,16c,8g6,8e,8c,16e,16c,8g6,8e,8c,16e,",
"16c,8g6,8e,c,p,8e,8e,8e,8e,g,8e,8c,8e,8c,8e,8c,",
"e,8c,8e,8e,8e,8e,8e,g,8e,8c,8e,8c,8g6,8g6,c."
9
Word
Byte
Word
Byte
Word
Stamp
→ Downloads → Educational Curriculum page.
Editor
' Piezospeaker connected to P9.
' General purpose counter.
' Variable stores characters.
' Index for pointing at data.
' Stores note character.
' Stores note frequency.
to
open
your
downloaded

Related parts for 28123