Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   autonomous location (http://www.chiefdelphi.com/forums/showthread.php?t=19621)

manodrum 28-03-2003 00:10

autonomous location
 
is it best to put the autonomous code in a SUB? or have it in the main loop? if it is in the main loop, how do you stop it from running if you aren't in autonomous mode? I read the article here:

http://www.combbat.com/programming/autonomous.shtml

and I'd like to do my autonomous that way, but I just need to know where to put it.

Thanks,
manodrum

Jeff_Rice 28-03-2003 00:24

We did it in a subroutine. That way, all we had to do was return at the end and thus we made sure we didn't accidently have it do autonomous when we were supposed to drive.

rust710 28-03-2003 07:45

I put ours in a sub and every function on our robot was in a sub and I always call all the subs, but at the top of the autonomous I put an if statement like this. if auton_mode = 0 then Return . This canceled the sub if we where not in autonomous mode.

Dusan 01-04-2003 20:57

3 bank software
 
Instead of using subs ... why don't you get the new version of P-basic and use multiple banks to switch between softwares.

It keeps it organized and its easy to use

i.e. If auton_mode = 1 THEN
run 2
ENDIF

... thats all it takes to switch between softwares .... if you have anymore questions about how to use it ... just e-mail me at
robostangs548@hotmail.com

rust710 02-04-2003 08:05

Multiple programs are nice but a program can be organized with subs. Multiple also works in the old version.


All times are GMT -5. The time now is 20:28.

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