28125 Parallax Inc, 28125 Datasheet - Page 155
28125
Manufacturer Part Number
28125
Description
TEXT ROBOTICS
Manufacturer
Parallax Inc
Datasheet
1.28125.pdf
(360 pages)
Specifications of 28125
Title
Robotics with the Boe-Bot
Product
Microcontroller Accessories
Lead Free Status / RoHS Status
Not applicable / Not applicable
- Current page: 155 of 360
- Download datasheet (5Mb)
Figure 4-5 shows part of a PBASIC program that contains a subroutine call and a
subroutine. The subroutine call is the
subroutine is everything from the
Here’s how it works. When the program gets to the
it looks for the
the
down line by line from the label, so you’ll see the message “Command in subroutine” in
your Debug Terminal.
program gets to the
command immediately after the
that displays the message “After subroutine”.
Example Program – OneSubroutine.bs2
' Robotics with the Boe-Bot - OneSubroutine.bs2
' This program demonstrates a simple subroutine call.
' {$STAMP BS2}
' {$PBASIC 2.5}
DEBUG "Before subroutine",CR
PAUSE 1000
GOSUB My_Subroutine
DEBUG "After subroutine", CR
END
My_Subroutine:
My_Subroutine:
√
2
Enter, save, and run OneSubroutine.bs2
My_Subroutine:
DO
LOOP
My_Subroutine:
DEBUG "Before subroutine",CR
PAUSE 1000
GOSUB My_Subroutine
DEBUG "After subroutine", CR
PAUSE 1000
DEBUG "Command in subroutine", CR
PAUSE 1000
RETURN
RETURN
label and starts executing commands. The program keeps going
PAUSE 1000
command, arrow (2) shows how it jumps back to the
GOSUB
My_Subroutine:
label. As shown by arrow (1), the program jumps to
GOSUB My_Subroutine
command. In this case, it’s a
causes a one second pause. Then, when the
label through the
GOSUB My_Subroutine
1
command. The actual
RETURN
DEBUG
Figure 4-5
Subroutine
Basics
command.
command,
command
Related parts for 28125
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: