27404 Parallax Inc, 27404 Datasheet - Page 202

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
' -----[ Subroutine - Calibrate_Qtis ]----------------------------------------
Calibrate_Qtis:
' -----[ Subroutine - Servos_And_Sensors ]------------------------------------
Servos_And_Sensors:
FOR counter = 1 TO 5
NEXT
RETURN
HIGH qtiPwrLeft
HIGH qtiSigLeft
PAUSE 1
RCTIME qtiSigLeft, 1, temp
LOW qtiPwrLeft
multi = temp
HIGH qtiPwrRight
HIGH qtiSigRight
PAUSE 1
RCTIME qtiSigRight, 1, temp
multi = (multi + temp) / 2
multi = multi / 4
IF multi > 220 THEN
ELSE
ENDIF
WRITE QtiThresh, Word multi
RETURN
GOSUB Pulse_Servos
' Call sensor subroutine(s).
sensors = 0
GOSUB Read_Object_Detectors
PAUSE 900
FREQOUT LedSpeaker, 100, 3000
multi = multi - 220
multi = 0
' 5 beeps, 1/second
' Turn left QTI on
' Discharge capacitor
' Measure charge time
' Turn left QTI off
' Free temp for another RCTIME
' Turn right QTI on
' Discharge capacitor
' Measure charge time
' Calculate average
' Take 1/4 average
' Account for code overhead
' Threshold to EEPROM
' Call Pulse_Servos subroutine
' Clear previous sensor values
' Call Read_Object_Detectors

Related parts for 27404