Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Programming Autonomous mode (http://www.chiefdelphi.com/forums/showthread.php?t=22641)

Jared Stofflett 10-11-2003 20:23

Programming Autonomous mode
 
How do you program Autonomous mode on the new controllers? I just figured I would go into the main.c file and fix it up the way I wanted it. The comments say not to edit this though, so any help on where to call the functions I write for Autonomous mode would be appreciated. In addition, how do you stop the joystick from getting input?

Jeremy_Mc 10-11-2003 20:42

In the user_functions.c there's a part that says "INSERT YOUR OWN CODE HERE" (or something to that effect). I'm assuming that's where you insert your own code ;)

On the other question, I believe the Programming Guide says there's no way to switch between autonomous and user modes on the EDU-Controller. (I might be wrong on that one) But you COULD make some auto. code and then upload diff code to practice driving... :)

Kel D 10-11-2003 21:34

From what I gather the only files, or whatever they are called, that you should change are the user_routines and the user_routines_fast. The other ones shouldn't be changed.

KevinB 11-11-2003 09:32

I would just connect a switch to one of the digital inputs and use that to control when the bot is in "autonomous" mode vs. driver-controlled mode.

Then just use an "if" statement:

Code:

if (rc_dig_in16) {
  // Run Autonomous Code
} else {
  // Run Driver Control Code
}

You could put this in the Process_Data_From_Master_uP() function found in user_routines.c. If you want to keep the default drive code, put it after the call to Default_Routine(), however you could nix the default drive code by replacing that call with your new code.


All times are GMT -5. The time now is 07:42.

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