27404 Parallax Inc, 27404 Datasheet - Page 137

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
As mentioned earlier, a variable doesn't have to store the QTI decay black/white
threshold value because it doesn't change after it is set at the beginning of the program.
This makes it a prime candidate for EEPROM storage. We can use a
set aside a word-size variable to hold this threshold value.
Even though the
downloaded, a
Any value that is stored in EEPROM will remain there even if the power is disconnected
from the SumoBot. The only things that can change that value are another
command, or a download with a
All commands in the
or
Each command that got replaced was commented, with an apostrophe
of it. Each command that was added has a comment to the right with either
or
time. Notice also that the threshold value is then copied from the
byte at the
qtiThreshold
' <--- New
' qtiThreshold
temp
multi
Add this
QtiThresh
' -----[ EEPROM Data ]-------------------------------------------------
QtiThresh
Go through and examine each commented command and its replacement in this
entire subroutine.
' -----[ Subroutine - Calibrate_Qtis ]---------------------------------
Calibrate_Qtis:
'
HIGH qtiPwrLeft
HIGH qtiSigLeft
PAUSE 1
QtiThresh
RCTIME qtiSigLeft, 1, qtiLeft
WRITE
. Notice that
DATA
DATA
variables can be replaced with commands that use
.
Calibrate_Qtis
directive writes a 0 to this EEPROM location when the program is
command can change this value after the program starts running.
address in EEPROM.
VAR
VAR
DATA
directive to give this EEPROM address the
VAR
multi
DATA
Word
Word
Word 0
Word
directive that overwrites it.
and
subroutine that involve the
temp
' Stores black/white threshold
' <--- New temporary variable
' <--- New multipurpose variable
are also used to calculate the threshold
' Word for QTI threshold time
' Turn left QTI on
' Discharge capacitor
' Measure charge time
multi
qtiLeft
'
temp
DATA
placed to the left
variable to the
Symbol
' <--- Add
,
directive to
and
qtiRight
multi
WRITE
name
,
.

Related parts for 27404