Joystick code for tournament

  1. 4 months ago

    How can I ensure that the joystick software will work with the tournament system?

    We are using robotC. If the team uses the template code, is that all they need to do?

    Is there a way to ensure the team number is programmed in?

    Is there a WIKI somewhere that I should read?

    Sorry for the NEWBEE questions. I am afraid we will travel 5 hours to the tournament only to find out that our joystick code doesn't work with the tournament system...

    #pragma platform(VEX)
    
    //Competition Control and Duration Settings
    #pragma competitionControl(Competition)
    #pragma autonomousDuration(15)
    #pragma userControlDuration(105)
    #include "Vex_Competition_Includes.c"  
    
    /******************************************************************
    * PRE_AUTON
    * initialization routine
    ******************************************************************/
    void pre_auton() {
    	bStopTasksBetweenModes = true;
    }
    
    /******************************************************************
    * AUTONOMOUS task
    ******************************************************************/
    task autonomous(){
    
    }
    
    void updateLCD(){
    	clearLCDLine(0);
    	clearLCDLine(1);
    	displayLCDCenteredString(0,"Barcbots Speed Demons");
    	displayLCDCenteredString(1,"11101A");
    }
    
    /******************************************************************
    * MAIN function
    ******************************************************************/
    task usercontrol()
    {
    	updateLCD();
    	startTask(driveTask);
    	startTask(coneLiftTask);
    	startTask(clawTask);
    	startTask(mobileGoalTask);
    
    	while(true){
    		wait1Msec(TASK_DELAY);
    	}
    }
  2. 536Mentor

    Oct 10 Event Partner, V5 Beta Tester Appleton, WI 536

    @CrisPierry How can I ensure that the joystick software will work with the tournament system?

    We are using robotC. If the team uses the template code, is that all they need to do?

    Is there a way to ensure the team number is programmed in?

    Is there a WIKI somewhere that I should read?

    Sorry for the NEWBEE questions. I am afraid we will travel 5 hours to the tournament only to find out that our joystick code doesn't work with the tournament system...

    Once your joystick is paired with your robot, there is NO concern that the software will NOT work with the tournament system as long as you are programmed on the competition template, which it appears you are. There is NO need to have your team number programmed in other than under advanced tools, Robot C will ask you to rename your robot, there you will put in the team number that the program is associated with. For us, that is 536A through 536F.

  3. Barin

    Oct 10 Arizona

    @CrisPierry Is there a way to ensure the team number is programmed in?[/code]

    @536Mentor There is NO need to have your team number programmed in other than under advanced tools, Robot C will ask you to rename your robot, there you will put in the team number that the program is associated with. For us, that is 536A through 536F.

    Putting your team number in there really doesn't actually do anything. The only way to ever see that number is through the Program or USB connections – field control can't see it.

  4. Barin

    Oct 10 Arizona

    @CrisPierry How can I ensure that the joystick software will work with the tournament system?

    Use a Competition Switch to simulate field control. Make sure you can't control your robot using anything on the joystick(s) while set to autonomous or disabled, and you have full control during driver control.

    If you don't have a Competition Switch, use the corresponding debug window in RobotC that will simulate a competition switch.

  5. Thank you. It looks like we are ok then!

  6. sankeydd

    Oct 11 Event Partner

    @Barin Use a Competition Switch to simulate field control.

    Definately. I have used these at tournaments on the skills field in the past. Works great and pretty cheap.

  7. jpearman

    Oct 11 Moderator, ROBOTC Tech Support, V5 Beta Moderator Rockstar, Los Angeles 8888

    @CrisPierry We are using robotC. If the team uses the template code, is that all they need to do?

    task usercontrol()
    {
    	updateLCD();
    	startTask(driveTask);
    	startTask(coneLiftTask);
    	startTask(clawTask);
    	startTask(mobileGoalTask);
    
    	while(true){
    		wait1Msec(TASK_DELAY);
    	}
    }

    You are starting lots of tasks, but where are they ?

  8. I didn’t include the whole code. I can put that later, after practice today.

  9. jpearman

    Oct 12 Moderator, ROBOTC Tech Support, V5 Beta Moderator Rockstar, Los Angeles 8888

    @CrisPierry I didn’t include the whole code. I can put that later, after practice today.

    No need to do that, just checking you were not expecting magic.

  10. Here it is anyway.

    Note: I need to learn about PIDs that myself before I can teach them so they are not using PID to position the cone lift arm, or the mobile goal lift.

    Our LCD function doesn't work at all - nothing is written to the LCD. We haven't had a chance to debug that it.

    I couldn't paste the code, so I am attaching as a .zip file

    - Cris

  11. tabor473

    Oct 12 V5 Beta Tester OYES, WPI

    @CrisPierry Here it is anyway.

    Note: I need to learn about PIDs that myself before I can teach them so they are not using PID to position the cone lift arm, or the mobile goal lift.

    Can I just say. Your code is incredibly well documented. I think it is the best documented program I have seen on the forum.

  12. Thanks! I hold the kids accountable for documenting their code!

 

or Sign Up to reply!