27404 Parallax Inc, 27404 Datasheet - Page 75

COMPETITION RING FOR SUMOBOT

27404

Manufacturer Part Number
27404
Description
COMPETITION RING FOR SUMOBOT
Manufacturer
Parallax Inc
Datasheet

Specifications of 27404

Accessory Type
Hobby and Education
Product
Microcontroller Accessories
Lead Free Status / RoHS Status
Contains lead / RoHS non-compliant
For Use With/related Products
SumoBot®
Lead Free Status / RoHS Status
Lead free / RoHS Compliant, Contains lead / RoHS non-compliant
While all the steps up to this point were purely mechanical, the Initialization section will
take some thought. There are several options. You can put the
from PushbuttonMode.bs2's initialization as the first, second or third step. To make the
decision, think about how the program would work if the
Then, consider how it would work differently if it was the second step, and so on. An
advantage to having it as the first step is that you can set the mode regardless of whether
the main program is going to run or not, so we'll try that.
Example Program: ResetAndStartMode.bs2
' -----[ Title ]--------------------------------------------------------------
' ---> Updated <---
' Applied Robotics with the SumoBot - ResetAndStartMode.bs2
' Program constructed by copying and pasting code from
' PushbuttonMode.bs2 into TestResetButton.bs2.
' {$STAMP BS2}
' {$PBASIC 2.5}
Copy the
section in PushbuttonMode.bs2, and paste it to the Initialization section in
ResetAndStartMode.bs2.
Copy the
paste it to the beginning of the Main Routine in ResetAndStartMode.bs2. The
ModeTest
If you have not already done so, delete the
ResetTest
Copy the
PushbuttonMode.bs2,
ResetAndStartMode.bs2.
ResetAndStartMode.bs2 is fine.
Update the Title section so that it has the current program name and a correct
program description.
Compare your program to ResetAndStartMode.bs2 shown below.
Be careful with END commands in the main routine. Both the ModeTest and ResetTest
routines contain END statements. If you forget to delete the END command at the end of
the ModeTest routine, you'll never get through the ResetTest routine..
ModeTest
IF pbSense = 1 THEN GOSUB Mode_Select
routine should come before the
routine.
Mode_Select
routine from the main routine in PushbuttonMode.bs2, and
and
subroutine from the Subroutines section in
paste
Pasting
it
it
' Target = BASIC Stamp 2
' Language = PBASIC 2.5
ResetTest
to
as
the
END
the
IF...THEN
Subroutines
routine.
that comes before the
last
IF...THEN
from the Initialization
is the first step.
subroutine
section
statement
in
in

Related parts for 27404