27403 Parallax Inc, 27403 Datasheet - Page 136
27403
Manufacturer Part Number
27403
Description
GUIDE APP ROBOTCS W/SUMOBOT V1.0
Manufacturer
Parallax Inc
Datasheet
1.27404.pdf
(266 pages)
Specifications of 27403
Accessory Type
Manual
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
- Current page: 136 of 266
- Download datasheet (6Mb)
ACTIVITY #8: VARIABLE MANAGEMENT FOR LARGE PROGRAMS
When you have a project with a lot of sensors and programmed machine reactions,
variable space can become pretty tight. For example, the program in the previous activity
uses three words and one byte. There's one byte to take each QTI reading, and another to
store the QTI threshold. All three of these bytes are used at the beginning of the
program, but only one (threshold) is accessed repeatedly as the program runs. Since
threshold isn't even changed repeatedly as the program runs, it's not necessarily the best
use of a RAM variable either.
This activity uses the techniques introduced in Chapter 2, Activity #2 to use and reuse
temporary variables. As you go through the activities in this book, you will use the same
few temporary variables to monitor sensors, control servos, log data, and perform a
variety of maneuvers. In virtually every subroutine you build to perform these functions,
the same few variables will be used in different ways. Even after the activities in this
book, you can continue to add functionality to your SumoBot, without worrying that the
next sensor might take up too much RAM.
Incorporating Temporary Variables into SensorsWithByteDisplay.bs2
It's important to modify the sensor testing program (SensorsWithByteDisplay.bs2) so that
it uses the memory management techniques introduced in ThreeVariablesManyJobs.bs2.
Specifically, it has to use and re-use temporary variables and use EEPROM to store and
access values that don't change frequently. After the program has been modified, features
like more sensors, servo control, navigation, and datalogging can be added in many cases
without ever having to declare any more RAM variables.
√
√
√
In order from
detectors - right side, right front, left front, left side. QTI line sensors - right
front, left front, pushbutton.
Start by saving SensorsWithByteDisplay.bs2 as SensorsWithTempVariables.bs2.
Next, the
be commented out. In place of these three variables, you can use two word
variables -
' -----[ Variables ]---------------------------------------------------
' qtiLeft
' qtiRight
qtiLeft
temp
BIT0
(short for temporary) and
,
VAR
VAR
qtiRight
to
BIT6
Word
Word
, and
, test the sensors in this order: infrared object
qtiThreshold
' Stores left QTI time
' Stores right QTI time
multi
(short for multipurpose).
variable declarations need to
Related parts for 27403
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: