EasyManuals Logo

Parallax Boe-Bot User Manual

Parallax Boe-Bot
360 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #154 background imageLoading...
Page #154 background image
Page 140 · Robotics with the Boe-Bot
' Ramp up right rotate.
FOR pulseCount = 0 TO 30
PULSOUT 13, 750 + pulseCount
PULSOUT 12, 750 + pulseCount
PAUSE 20
NEXT
' Ramp down right rotate
FOR pulseCount = 30 TO 0
PULSOUT 13, 750 + pulseCount
PULSOUT 12, 750 + pulseCount
PAUSE 20
NEXT
Open ForwardLeftRightBackward.bs2 from Activity #1, and save it as
ForwardLeftRightBackwardRamping.bs2.
Modify the new program so your Boe-Bot will ramp into and out of each
maneuver. Hint: you might use the code snippets above, and similar snippets
from StartAndStopWithRamping.bs2.
ACTIVITY #5: SIMPLIFY NAVIGATION WITH SUBROUTINES
In the next chapter, your Boe-Bot will have to perform maneuvers to avoid obstacles.
One of the key ingredients to avoiding obstacles is executing pre-programmed
maneuvers. One way of executing pre-programmed maneuvers is with subroutines. This
activity introduces subroutines, and also two different approaches to creating reusable
maneuvers with subroutines.
Inside the Subroutine
There are two parts of a PBASIC subroutine. One part is the subroutine call. It’s the
command in the program that tells it to jump to the reusable part of code, then come back
when it’s done. The other part is the actual subroutine. It starts with a label that serves
as its name and ends with a
RETURN command. The commands between the label and
the
RETURN command make up the code block that does the job you want the subroutine
to do.

Table of Contents

Other manuals for Parallax Boe-Bot

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Parallax Boe-Bot and is the answer not in the manual?

Parallax Boe-Bot Specifications

General IconGeneral
BrandParallax
ModelBoe-Bot
CategoryRobotics
LanguageEnglish