Skip to content

Instantly share code, notes, and snippets.

@Harrix
Created September 24, 2022 05:10
Show Gist options
  • Select an option

  • Save Harrix/af6f18dbe1b124eda30988141c5de5e3 to your computer and use it in GitHub Desktop.

Select an option

Save Harrix/af6f18dbe1b124eda30988141c5de5e3 to your computer and use it in GitHub Desktop.
#pragma config(Motor, port1, leftMotor, tmotorVex393_HBridge, openLoop)
#pragma config(Motor, port2, shoulder, tmotorVex393_MC29, openLoop, reversed)
#pragma config(Motor, port3, elbow, tmotorVex393_MC29, openLoop, reversed)
#pragma config(Motor, port4, brush, tmotorVex269_MC29, openLoop)
#pragma config(Motor, port5, clow, tmotorVex393_MC29, openLoop)
#pragma config(Motor, port10, rightMotor, tmotorVex393_HBridge, openLoop, reversed)
task main ()
{
while(1 == 1)
{
motor[leftMotor] = vexRT[Ch3]/2;
motor[rightMotor] = vexRT[Ch2]/2;
// Up-down shoulder
if(vexRT[Btn6U] == 1)
{
motor[shoulder] = 127;
}
else if(vexRT[Btn6D] == 1)
{
motor[shoulder] = -127;
}
else
{
motor[shoulder] = 0;
}
// Up-down elbow
if(vexRT[Btn5U] == 1)
{
motor[elbow] = 127;
}
else if(vexRT[Btn5D] == 1)
{
motor[elbow] = -127;
}
else
{
motor[elbow] = 0;
}
// Rotate brush
if(vexRT[Btn7L] == 1)
{
motor[brush] = 127;
}
else if(vexRT[Btn7R] == 1)
{
motor[brush] = -127;
}
else
{
motor[brush] = 0;
}
// Clow
if(vexRT[Btn8L] == 1)
{
motor[clow] = 127;
}
else if(vexRT[Btn8R] == 1)
{
motor[clow] = -127;
}
else
{
motor[clow] = 0;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment