Skip to content

Instantly share code, notes, and snippets.

@bradllj
Last active November 18, 2015 02:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bradllj/de66904703b03a5a3f94 to your computer and use it in GitHub Desktop.
Save bradllj/de66904703b03a5a3f94 to your computer and use it in GitHub Desktop.
#pragma config(Motor, port7, claw, tmotorVex393_MC29, openLoop)
...
void clawopen (int time)
{
motor[claw]=80;
wait1Msec(time);
motor[claw]=0;
}
...
task autonomous()
{
if(SensorValue(button1)==1)
{
driveforward (400);
clawclose(700);
armup (1600);
drivebackwards(890);
turnleft(400);
driveforward(500);
armdown(2200);
wait1Msec(500);
clawopen (1000);
drivebackwards(1000);
}
else
{
swingleft(200);//blue
clawclose(700);
armup (1600);
drivebackwards(800);
turnright(550);
driveforward(500);
armdown(2200);
wait1Msec(500);
clawopen (1000);
drivebackwards(1000);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment