Skip to content

Instantly share code, notes, and snippets.

Created October 25, 2014 06:30
Show Gist options
  • Save anonymous/6884d3bcfc5430d3745c to your computer and use it in GitHub Desktop.
Save anonymous/6884d3bcfc5430d3745c to your computer and use it in GitHub Desktop.
#pragma config(Motor, port3, leftMotor, tmotorVex393_MC29, openLoop)
#pragma config(Motor, port4, rightMotor, tmotorVex393_MC29, openLoop, reversed)
#pragma config(Motor, port5, handServo, tmotorServoStandard, openLoop)
#pragma config(Motor, port8, handServo2, tmotorServoStandard, openLoop)
#pragma config(Motor, port9, armMotor, tmotorVex269_MC29, openLoop)
task main ()
{
int handState = 0;
int maxServo = 127;
motor[handServo] = handState;
motor[handServo2] = handState;
wait1Msec(2000);
while(1 == 1) {
motor[leftMotor] = vexRT[Ch3]; // Left Joystick Y value
motor[rightMotor] = vexRT[Ch2]; // Right Joystick Y value
motor[armMotor] = vexRT[Ch5]; // Arm motor
if (vexRT[Btn5U] == 1) {
if (handState < maxServo) {
handState += 10;
}
motor[handServo] = handState;
motor[handServo2] = handState * -1;
}
if (vexRT[Btn5D] == 1) {
if (handState > (maxServo * -1) ) {
handState -= 10;
}
motor[handServo] = handState * -1;
motor[handServo2] = handState;
}
delay(2000);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment