Quick Question About Autonomous Code ... No Sensors ...

Hi, would this code work as an autonomous code ?
it is just i have been having problems, i think i have done it completely wrong
if it is wrong, can someone give me some pointers

… NOTE … The Times are all rubbish … need to actually time the stuff

Here Is The Code !

task autonomous()
{
wait1Msec(100);
motor[drivel] = -127;
motor[driver] = 127;
wait1Msec(500); //how long it takes to turn on foam tiles
motor[drivel] = 127;
motor[driver] = 127;
wait1Msec(150); //how long forward until lined up
motor[drivel] = 127;
motor[driver] = 127;
wait1Msec(150); // how long until it gets 2 stack of sacks
motor[in1] = -127;
motor[in2] = -127;
wait1Msec(200); //how long for sacks to intake … average … guess ?
motor[arm1] = 127;
motor[arm2] = 127;
motor[arm3] = 127;
motor[arm4] = 127;
wait1Msec(200); //how long to lift arm to right level
motor[drivel] = 127;
motor[driver] = 127;
wait1Msec(200); // how long until it gets to the troth
motor[in1] = 127;
motor[in2] = 127;
wait1Msec(200); // how long to get rid off sacks
motor[drivel] = -127;
motor[driver] = -127;
wait1Msec(200); //how long 2 get back to start tile
motor[drivel] = -127;
motor[driver] = 127;
wait1Msec(200); //how long 2 turn
motor[drivel] = -127;
motor[driver] = -127;
wait1Msec(200); //how long 2 hit start tile, so we can reposition
}

Sensors are your friend! :slight_smile:

That said, I don’t see anything particularly wrong with the code, as long as you’re just trying to turn on two motors for amounts of time.

I highly recommend checking out some of the free tutorials we have posted, here: http://www.education.rec.ri.cmu.edu/products/teaching_robotc_cortex/index.html

Start in the movement section and work your way across. It will save you a ton of time and cover a lot of the basics.