27404 Parallax Inc, 27404 Datasheet - Page 249

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 - Servos_And_Sensors ]------------------------------------
Servos_And_Sensors:
' -----[ Subroutine - Pulse_Servos ]------------------------------------------
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
#IF DEBUG_MODE = 1 #THEN
#ENDIF
#IF DATALOG_MODE = 1 #THEN
#ENDIF
GOSUB Pulse_Servos
' Call sensor subroutine(s).
sensors = 0
GOSUB Read_Object_Detectors
GOSUB Read_Line_Sensors
RETURN
multi = multi - 220
multi = 0
GOSUB Display_All
temp.HIGHBYTE = sensors
temp.NIB1 = state
temp.NIB0 = maneuver
WRITE LogData + LogIndex, Word temp
logIndex = logIndex + 2
IF logIndex >= (LogData + MaxBytes) THEN END
' 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 Display_All subroutine
' Copy values to parts of temp
' Store record in EEPROM
' Word values -> index + 2
' Call Pulse_Servos subroutine
' Clear previous sensor values
' Call Read_Object_Detectors
' Look for lines

Related parts for 27404