Created
September 24, 2022 05:10
-
-
Save Harrix/af6f18dbe1b124eda30988141c5de5e3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #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