under the File menu->new->Driver Skill Template, there is a “example code”.
Since we got a damaged field control, there’s no way to test our code before real game, and no way for us to know if our code workding. We just not sure about the code format:confused:
here’s a little code:
**
#pragma config(Sensor, dgtl1, encoder1, sensorQuadEncoder)
#pragma config(Motor, port1, motor1, tmotorVex393_HBridge, openLoop)
//!!Code automatically generated by ‘ROBOTC’ configuration wizard !!//
#pragma platform(VEX)
//Competition Control and Duration Settings
#pragma competitionControl(Competition)
#pragma autonomousDuration(0)
#pragma userControlDuration(60)
#include “Vex_Competition_Includes.c”
void pre_auton()
{
// Set bStopTasksBetweenModes to false if you want to keep user created tasks running between
// Autonomous and Tele-Op modes. You will need to manage all user created tasks if set to false.
bStopTasksBetweenModes = true;//I dont know how to set this when doing 60s auto.
SensorValue[encoder1] = 0;
}
void move(){
while(SensorValue[encoder1] < 10000){
motor[motor1] = 127;
}motor[motor1] = 0;
}
task autonomous()
{
motor[motor1] = -127;
wait1Msec(1000);
move(); // Remove this function call once you have “real” code.
}
task usercontrol()
{
while (true)
{
motor[motor1] = vexRT[Ch1];
}
}
**
Could this code work during real game?
Could anyone give some detail advise on how to use ROBTOC to programming 60s autonomous:eek: