Coding for partner controller

  1. 5 weeks ago

    Squirrel here! just wondering if anyone can help we (621C,B)have been trying to code for a partner controller and it is being really crappy but I believe we have a good start here is the code:

    task usercontrol()
    {
    while(true){
    if( (nVexRCReceiveState & vrXmit2) ) {
    motor[port5] = vexRT[Ch2Xmtr2];
    motor[port6] = vexRT[Ch2Xmtr2];
    if(vexRT[Btn6UXmtr2]){
    motor[port7] = 90;

    }

    else if(vexRT[Btn6DXmtr2]) {
    motor[port7] = -60;

    }

    else {

    motor[port7]=0;
    }
    }

    else {
    motor[port5] = vexRT[Ch2];
    motor[port6] = vexRT[Ch2];
    if(vexRT[Btn6U]){
    motor[port7] = 90;

    }

    else if(vexRT[Btn6D]) {
    motor[port7] = -60;

    }

    else {

    motor[port7]=0;
    }
    }

    motor[port2] = vexRT[Ch3] + vexRT[Ch4];
    motor[port3] = vexRT[Ch3] - vexRT[Ch4];
    motor[port9] = vexRT[Ch3] + vexRT[Ch4];
    motor[port8] = vexRT[Ch3] - vexRT[Ch4];
    // motor[port4] = vexRT[Ch2];
    if(vexRT[Btn5U]){
    motor[port4] = 90;

    }

    else if(vexRT[Btn5D] && SensorValue [mogoP]>1680){
    motor[port4] = -60;

    }

    else {

    motor[port4]=0;

    }

    }
    }

 

or Sign Up to reply!