Go to Post Too bad MI isn't allowed to participate in FTC - Cory [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #23   Spotlight this post!  
Unread 03-02-2003, 23:52
wwrye wwrye is offline
Registered User
#0057 (Leopards)
 
Join Date: Jan 2003
Location: Houston
Posts: 18
wwrye is an unknown quantity at this point
Angry redundance

Mike, what is up with all the identical code, don't you think you could go with the flow of the main loop and just do something like this:
Code:
':::Timer variables
cntr_cycles 	VAR byte
seconds		VAR nib '15 sec timer,make byte for more time

seconds = 0           'same as your realtime variable
cntr_cycles = 0       'same as your time variable

...

if auton_mode = 1 then do_auton

	'non autonomous code	

	
goto skip_auton
do_auton:

':::15 second TIMER::
	if cntr_cycles >= 38 then update_timer

	goto skip_update_timer
	update_timer:
		seconds = seconds + 1
		cntr_cycles = 0
	
	skip_update_timer:

		select seconds
			case <6  'until seconds = 5
				drive_R = 180	'put drive commands accordingly
				drive_L = 180
			case <11 
				drive_R = 127
				drive_L = 127
			case <16
				drive_R = 64
				drive_L = 190	
		endselect

	cntr_cycles = cntr_cycles + 1 + delta_t
	'debug ?cntr_cycles, tab, ?delta_t, tab, ?cntr_cycles, cr
':::15 second TIMER::
Questions/comments, pm me
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Timing of nats for next year Ian W. Championship Event 13 03-03-2003 18:28
Way back there. Size of Nationals, and a solution archiver 2001 23 24-06-2002 03:28
what is or isn't a timing belt? archiver 2001 6 23-06-2002 23:26
two sided timing belt archiver 2001 3 23-06-2002 22:34
Dual Sided Timing Belts Lachuck894 Technical Discussion 9 14-01-2002 10:10


All times are GMT -5. The time now is 10:34.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


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