Programming instructions
ROBOTC
ROBOTC Programming - Competition Templates • 4
©
2011 Carnegie Mellon Robotics Academy / For use with VEX Robotics Systems
Pre-Autonomous Period
Placeyourinitializationcodeinsidethisfunction.Duringthepre-autonomousperiod,codecanbe
executedtocongureyourrobotbeforetheactualcompetitionbegins.Validcodeforthissection
includestaskssuchasclearingencoders,reectingmotors,andsettinginitialservopositions.
Note: Thiscodeexecutesonlyonceandrunsbeforethecompetitionbegins.
void pre_autonomous()
{
//Place pre-autonomous code here
}
ROBOTC Programming Competition Templates (cont.)
task autonomous()
{
//Place autonomous code here
AutonomousCodePlaceholderForTesting();
}
Autonomous Period
Placeyourautonomouscodeinsidethistask.Duringtheautonomousperiod,therobotperformsthe
pre-programmedactionsonce,oruntilitisdisabledbytheeldcontrolsystem(orforthelengthof
timespeciedintheautonomousDuration(time)pragmastatement,forVEXPICbasedrobots
usingthe75MHzCystals).TheAutonomousCodePlaceholderForTesting();functionisonlya
placeholderandshould be replacedwithyourowncode.
VEXPICbasedrobotsusingthe75MHzCrystalscannotacceptcommandsfromtheRadioControl
Transmitterduringtheautonomousperiod,buttheyrequirethatthesignalbepresentasasafety
precaution.Theautonomousperiodduringacompetitioncannotbeskippedbyshuttingthetransmitteroff;
doingsowitharobotusingthe75MHzcrystalswillpausetheVEX’sinternaltimers,potentiallycausingthe
robottoentertheUserControlperiodlaterthanitshould.
AlsonotethattheAutonomousCodePlaceholderForTesting();functioncontainsawhile(true)
loopthatcanpreventuser-writtenautonomouscodefromexecuting.Removethisfunctiontoavoidany
unexpectedbehaviorduringtheautonomousperiod.
Important Information - Transmitter Signal
VEX ROBOTICS COMPETITION