27404 Parallax Inc, 27404 Datasheet - Page 127

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
The subroutine for the pushbutton needs a different approach. Remember that
and
output
Read_Line_Sensors
DummyPin
Start by opening all of the following programs:
Save QtiPulseDecayTrick.bs2 as TestAllSensors.bs2
Copy and paste the I/O definitions and variables from the other programs into
your new program.
Add one more bit variable that was not found in the other programs, to store the
state of the pushbutton:
pushbutton
Make subroutines for the speaker, IR detectors, and QTI detectors from the
functional portions of their test programs. If the actual work of a sensor is done
in the program's Main Routine, (like IR object detection), paste that part of the
routine into a subroutine. For example, a
could take four lines from the Main Routine of TestFrontIrObjectDetectors.bs2,
and four more from TestSideIrObjectDetectors.bs2.
Read_Object_Detectors:
when
FREQOUT IrLedRS, 1, IrFreq
irRS = ~IrSenseRS
FREQOUT IrLedRF, 1, IrFreq
irRF = ~IrSenseRF
FREQOUT IrLedLF, 1, IrFreq
irLF = ~IrSenseLF
FREQOUT IrLedLS, 1, IrFreq
irLS = ~IrSenseLS
RETURN
o
o
o
o
o
both reference P6, which is serving two purposes. It's getting used as an
TestLedSpeaker.bs2
TestPushButton.bs2
TestFrontIrObjectDetectors.bs2
QtiPulseDecayTrick.bs2
TestSideIrObjectDetectors.bs2
DummyPin
subroutine. For P6 to next be used to monitor the pushbutton, it
VAR
sends
Bit
the
PULSOUT
Read_Object_Detectors
' Right side IR LED headlight
' Save right side IR receiver
' Repeat for right-front
' Repeat for left-front
' Repeat for left side
command
pulses
from
subroutine
pbSense
the

Related parts for 27404