28123 Parallax Inc, 28123 Datasheet - Page 34

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
How FirstProgram.bs2 Works
The first two lines in the example are called comments. A comment is a line of text that
gets ignored by the BASIC Stamp Editor, because it’s meant for a human reading the
program, not for the BASIC Stamp module. In PBASIC, everything to the right of an
apostrophe is normally considered to be a comment by the BASIC Stamp Editor. The
first comment tells which book the example program is from, and the program’s
filename. The second comment contains a handy, one-line description that explains what
the program does.
Although comments are ignored most of the time, the BASIC Stamp Editor does search
through comments for special directives. Every program in this text will use these two
directives:
The first directive is called the $STAMP Directive, and it tells the BASIC Stamp Editor
that you will be downloading the program specifically to a BASIC Stamp 2 module. The
second directive is called the $PBASIC directive, and it tells the BASIC Stamp Editor
that you are using version 2.5 of the PBASIC programming language. Note that these
compiler directives are enclosed in braces { } not parentheses ( ). You should always use
the toolbar icons to place these compiler directives in your program to avoid typing
errors. Also, entering the compiler directives by hand may not activate the syntax
highlighting in the BASIC Stamp Editor. That function is what causes various letters,
characters and words in your program to appear in different colors and capitalizations.
Syntax highlighting makes your programs easier to read, understand, and correct if there
are any bugs in them.
' What's a Microcontroller - FirstProgram.bs2
' BASIC Stamp sends message to Debug Terminal.
' {$STAMP BS2}
' {$PBASIC 2.5}
The BASIC Stamp Editor has shortcuts for most common tasks. For example, to run a
program, you can press the ‘Ctrl’ and ‘R’ keys at the same time. You can also click the Run
button. It’s the blue triangle shown in Figure 1-41 that looks like a CD player’s Play button.
The flyover help (the Run hint) will appear if you point at the Run button with your mouse.
You can get similar hints to find out what the other buttons do by pointing at them too.
Figure 1-41
BASIC Stamp Editor
Shortcut Buttons

Related parts for 28123