Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   FIRST Tech Challenge (http://www.chiefdelphi.com/forums/forumdisplay.php?f=146)
-   -   on the fly vex autonomus mode (http://www.chiefdelphi.com/forums/showthread.php?t=39913)

CmptrGk 06-10-2005 21:58

on the fly vex autonomus mode
 
i just got the vex program module today. I'm using the code from http://www.vexlabs.com because I'm already using similar code on the FRC controller.

i would like to use rc_dig_in16 to enable and disable the autonomous mode. I've tried
Code:

if(rc_dig_in16 == 1)
  {
        autonomous_mode = 1;
  }
  else if(rc_dig_in16 == 0)
  {
        autonomous_mode = 0;
  }

in both main.c and user_routines_fast.c

i think that my problem lies in the fact that autonomus is enabled differnetly on the vex controller because of the following code:
Code:

#if ENABLE_AUTONOMOUS_MODE
        txdata.user_cmd = 0x02;          /* Tell master you want to be in auton mode. */
#endif

i bet i could get this to work if i knew the "code" for normal user mode i could do something like this:
Code:

if (rc_dig_in16 == 1)
{
        txdata.user_cmd = 0x02;
}
else
{
        txdata.user_cmd = whatever is the user mode;
}

if anybody knows whether this will work or not, please help.


All times are GMT -5. The time now is 18:45.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi