28123 Parallax Inc, 28123 Datasheet - Page 215
28123
Manufacturer Part Number
28123
Description
TEXT WHAT'S A MICROCONTROLLER
Manufacturer
Parallax Inc
Type
Programmingr
Datasheet
1.28123.pdf
(340 pages)
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
- Current page: 215 of 340
- Download datasheet (6Mb)
Example Program: SimpleSubroutines.bs2
This example program shows how subroutines work by sending messages to the Debug
Terminal.
' What's a Microcontroller - SimpleSubroutines.bs2
' Demonstrate how subroutines work.
' {$STAMP BS2}
' {$PBASIC 2.5}
DO
DEBUG CLS, "Start main routine.", CR
√
√
√
What’s a label? A label is a name that can be used as a placeholder in your program.
GOSUB
ON GOTO
end with a colon, and for the sake of style, separate words with the underscore character.
When picking a name for a label, make sure not to use a reserved word. The rest of the
rules for a label name are the same as the ones for naming variables listed in the
information box on page 53.
Examine SimpleSubroutines.bs2 and try to guess the order in which the
commands will be executed.
Enter and run the program.
Compare the program’s actual behavior with your predictions.
DO
LOOP
Subroutine_Name:
RETURN
is one of the commands you can use to jump to a label. Some others are
GOSUB Subroutine_Name
DEBUG "Next command"
DEBUG "This is a subroutine..."
PAUSE 3000
, and
ON GOSUB
. You can use these commands to jump to labels. A label must
Figure 7-11
How
Subroutines
Work
GOTO
DEBUG
,
Related parts for 28123
Image
Part Number
Description
Manufacturer
Datasheet
Request
R
Part Number:
Description:
Microcontroller Modules & Accessories DISCONTINUED BY PARALLAX
Manufacturer:
Parallax Inc
Part Number:
Description:
BOOK UNDERSTANDING SIGNALS
Manufacturer:
Parallax Inc
Datasheet:
Part Number:
Description:
COMPETITION RING FOR SUMOBOT
Manufacturer:
Parallax Inc
Datasheet:
Part Number:
Description:
TEXT INFRARED REMOTE FOR BOE-BOT
Manufacturer:
Parallax Inc
Datasheet:
Part Number:
Description:
BOARD EXPERIMENT+LCD NX-1000
Manufacturer:
Parallax Inc
Datasheet:
Part Number:
Description:
CONTROLLER 16SERVO MOTOR CONTROL
Manufacturer:
Parallax Inc
Datasheet:
Part Number:
Description:
BASIC STAMP LOGIC ANALYZER
Manufacturer:
Parallax Inc
Datasheet:
Part Number:
Description:
IC MCU 2K FLASH 50MHZ SO-18
Manufacturer:
Parallax Inc
Datasheet: