28123 Parallax Inc, 28123 Datasheet - Page 216

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
LOOP
First_Subroutine:
RETURN
Second_Subroutine:
RETURN
How SimpleSubroutines.bs2 Works
Figure 7-12 shows how the
works.
First_Subroutine:
When the program gets to the
comes right after the
PAUSE 2000
GOSUB First_Subroutine
DEBUG "Back in main.", CR
PAUSE 2000
GOSUB Second_Subroutine
DEBUG "Repeat main...", CR
PAUSE 2000
DEBUG "
DEBUG "subroutine.", CR
PAUSE 3000
DEBUG "
DEBUG "subroutine.", CR
PAUSE 3000
The command
What’s a subroutine call? When you use the
to a subroutine, it is called a subroutine call.
Executing first "
Executing second "
GOSUB
label. The three commands inside that subroutine are executed.
GOSUB
command, which is
First_Subroutine
RETURN
First_Subroutine
statement, it jumps back to the command that
DEBUG
call in the main routine (the
GOSUB
"
Back in Main.
command to make the program jump
sends the program to the
"
, CR
.
DO…LOOP
)

Related parts for 28123