28125 Parallax Inc, 28125 Datasheet - Page 156
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: 156 of 360
- Download datasheet (5Mb)
Here’s an example program that has two subroutines. One subroutine makes a high
pitched tone while the other makes a low pitched tone. The commands between
LOOP
Example Program – TwoSubroutines.bs2
' Robotics with the Boe-Bot - TwoSubroutines.bs2
' This program demonstrates that a subroutine is a reusable block of commands.
' {$STAMP BS2}
' {$PBASIC 2.5}
DO
LOOP
High_Pitch:
Low_Pitch:
Let’s try putting the forward, left, right, and backward navigation routines inside
subroutines. Here’s an example:
DEBUG "Command in subroutine", CR
PAUSE 1000
RETURN
GOSUB High_Pitch
DEBUG "Back in main", CR
PAUSE 1000
GOSUB Low_Pitch
DEBUG "Back in main again", CR
PAUSE 1000
DEBUG "Repeat...",CR,CR
DEBUG "High pitch", CR
FREQOUT 4, 2000, 3500
RETURN
DEBUG "Low pitch", CR
FREQOUT 4, 2000, 2000
RETURN
√
√
call each of the subroutines in turn. Try this program and note the effect.
Watch your Debug Terminal, and press the Reset button a few times. You
should get the same set of three messages in the right order each time.
Enter, save, and run TwoSubroutines.bs2
DO
and
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: