Cortex VEXnet Manual de instrucciones Pagina 32

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 95
  • Tabla de contenidos
  • SOLUCIÓN DE PROBLEMAS
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 31
ROBOTC
ROBOTC Programming - Competition Templates 2
©
2011 Carnegie Mellon Robotics Academy / For use with VEX Robotics Systems
ShownbelowarethecontentsoftheCompetition.clewithbriefdescriptions,butwiththecomments
removed.Additionaldetailsareavailablethroughoutthedocument.
#pragma platform(VEX)
#pragma competitionControl(Competition)
#pragma autonomousDuration(20)
#pragma userControlDuration(120)
#include “Vex_Competition_Includes.c”
void pre_autonomous()
{
//Place pre-autonomous code here
}
task autonomous()
{
//Place autonomous code here
AutonomousCodePlaceholderForTesting();
}
task usercontrol()
{
while(true)
{
//Place user control code here
UserControlCodePlaceholderForTesting();
}
}
Thispragmastatementspecies
theVEXastheplatformtype.
Thispragmastatementenables
competitioncontrol.
Thesepragmastatementsspecifythe
duration(20and120seconddefaults)ofthe
autonomousandusercontrolmodesforVEX
PICbasedrobotsusingthe75MHzCrystals.
VEXCortexandVEX1.5(VEXnetUpgraded
PIC)basedrobotswillignoretheselines;
whichmodetheyareinandthedurationare
controlledusingtheeldcontrolsystem.
Thisincludelecontainsthefunctionality
necessaryfortherobottooperatewiththe
VEXeldcontrol.DoNOTmodifytheinclude
leorremovethislineofcode.
Anyinitializationcode,suchassetting
servopositionsorclearingencoder
valuescanbeplacedwithinthe
pre_autonomous()function.
Allcodefortheautonomousportion
ofthecompetitionshouldbeplaced
withintheautonomous task.The
AutonomousCodePlaceholderForTesting
functioncanberemovedonceyouplaceyour
owncodewithinthetask.
Allcodefortheusercontrolportionofthe
competitionshouldbeplacedwithinthewhile()
loopoftheusercontrol task.Thewhile()loop
repeatsallcommandswithinitscurlybrackets
forthedurationoftheusercontrolportionof
thecompetition,ensuringthatthetransmitter
dataandanyothervaluesareup-to-date.The
UserControlCodePlaceholderForTesting
functioncanberemovedonceyouplaceyour
owncodewithinthetask.
3. AnewlenamedCompetition.cwillappear.Beforemakinganychangestothetemplate,gotoFile,
selectSave As...andsavethisprograminalocationandunderanameyouwillremember.
ROBOTC Programming Competition Templates (cont.)
VEX ROBOTICS COMPETITION
Vista de pagina 31
1 2 ... 27 28 29 30 31 32 33 34 35 36 37 ... 94 95

Comentarios a estos manuales

Sin comentarios