27404 Parallax Inc, 27404 Datasheet - Page 110

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
LOOP
' -----[ Subroutine - Read_Line_Sensors ]-------------------------------------
Read_Line_Sensors:
Your Turn - QTI Navigation Decisions
Incorporating navigation can be as simple as an
subroutines that perform preprogrammed maneuvers. Instead of subroutine calls, the
code block below uses
ENDIF
PAUSE 100
HIGH qtiPwrLeft
HIGH qtiSigLeft
PAUSE 1
RCTIME qtiSigLeft, 1, qtiLeft
LOW qtiPwrLeft
HIGH qtiPwrRight
HIGH qtiSigRight
PAUSE 1
RCTIME qtiSigRight, 1, qtiRight
RETURN
DEBUG "Black"
Save QtiSelfCalibrate.bs2 as QtiSelfCalibrateYourTurn.bs2
Remove the two
' Indicate maneuver that should be taken based on QTI readings
DEBUG CR, "Maneuver",
IF qtiLeft < qtiThreshold AND qtiRight < qtiThreshold THEN
ELSEIF qtiLeft < qtiThreshold THEN
ELSEIF qtiRight < qtiThreshold THEN
ELSE
ENDIF
DEBUG CLREOL
DEBUG "Avoid tawara - both"
DEBUG "Avoid tawara - left"
DEBUG "Avoid tawara - right"
DEBUG "search"
CR, "-----------", CR
DEBUG
IF...THEN...ENDIF
commands to display what action should be taken.
code blocks, and replace them with this:
' Delay for slower PCs
' Turn left QTI on
' Discharge capacitor
' Measure charge time
' Turn left QTI off
' Turn right QTI on
' Discharge capacitor
' Measure charge time
IF...THEN
statement that calls

Related parts for 27404