27404 Parallax Inc, 27404 Datasheet - Page 74

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
One of the most important ingredients of modular programs is keeping the same naming
conventions for variables. For example, in this book,
used to receive and manipulate stored information and sensor measurements. After
decisions are made based on
next subroutine. The same applies to the
loop in one subroutine, it is free to count in a different loop in the next subroutine.
In this activity, you will combine two programs that were developed in this chapter:
TestResetButton.bs2 from Activity #3, and PushbuttonMode.bs2 from Activity #5.
Because both programs follow the same rules for sectioning and temporary variable use,
they will be really easy to combine.
sections (I/O Definitions, Variables, EEPROM Data, Subroutines and so on). Both
programs also follow the same naming conventions for reusable variables like
counter
application programs building blocks for future programs.
Combining the Reset and Pushbutton Mode Programs
The first step to combining TestResetButton.bs2 and PushbuttonMode.bs2 is to save a
copy of one of the programs.
ResetAndStartMode.bs2. Then, we'll copy the elements from PushbuttonMode.bs2 that
were not already in TestResetButton.bs2. For example, TestResetButton.bs2 already had
the
PIN
ResetAndStartMode.bs2.
EEPROM Data, Initialization, etc), we'll have a complete program that performs both the
reset-start function and the mode-select function.
LedSpeaker PIN
directive
Open TestResetButton.bs2 and save it as ResetStartAndMode.bs2
Open PushbuttonMode.bs2.
Copy the
PushbuttonMode.bs2, and paste it into the I/O definitions section in
ResetAndStartMode.bs2.
Copy the
PushbuttonMode.bs2, and paste it to the EEPROM Data section in
ResetAndStartMode.bs2.
. As you will see, these are two key ingredients for making all of your test and
will
ModeSelect DATA
pbSense
directive, but not the
be
After repeating this process for each section (Variables,
temp
copied
PIN
in one subroutine,
directive from the I/O definitions section in
We'll start by saving TestResetButton.bs2 as
directive from the EEPROM Data section in
counter
from
Both of these programs have clearly defined
pbSense PIN
PushbuttonMode.bs2
variable. When it's done counting in a
temp
temp
is always free to be used in the
is a temporary variable that is
directive. So, the
to
the
temp
pbSense
new
and

Related parts for 27404