Go to Post Mmmmm, First Choice day. I can already taste the latency. - ttldomination [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
  #33   Spotlight this post!  
Unread 20-02-2003, 16:38
rbayer's Avatar Unsung FIRST Hero
rbayer rbayer is offline
Blood, Sweat, and Code
no team (Teamless Orphan)
 
Join Date: Mar 2002
Rookie Year: 2001
Location: Minnetonka, MN
Posts: 1,087
rbayer is a glorious beacon of lightrbayer is a glorious beacon of lightrbayer is a glorious beacon of lightrbayer is a glorious beacon of lightrbayer is a glorious beacon of light
Send a message via AIM to rbayer
Quote:
Originally posted by EbonySeraphim
What I meant is that, in program, you don't always want to have to test for every condition. Its better to think through the problem in a way that will solve itself while processing the data. If you check this and that condition, things just get too complicated, and usually certain stimuli fall into the same condition as something else not intended. Don't get me wrong, there are some clear cases that many if's are needed.
The same thing is true of your line following code, I would assume. Something like the following is the way I would do it, but I'm sure other people are doing it other ways:

if rc_sw1=rc_sw2 then PWM1=254 : PWM2=254 : goto endTracking
if rc_sw1=1 then PWM1=0 : PWM2=254 : goto endTracking
PWM1=254
PWM2=0
endTracking:

Here's the guts of my dead-reckoning (I don't remember the actual numbers):

counter=counter+1+delta_t
SELECT counter
CASE 0 to 100
'do something
CASE 101 to 200
'do something else
CASE ELSE
'do yet another thing
ENDSELECT

Could you please explain what you mean by "its remembering what happend over the last X amount of seconds that would take a bit of memory" as I'm not quite sure why you need to "remember" anything if you are just using a normal counter.

Anyways, I sent you a PM about that line of code and my (late-night)reasoning behind it.

--Rob
__________________
New C-based RoboEmu2 (code simulator) available at: http://www.robbayer.com/software.php
 


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
autonomous mode problem on field Chris_C Programming 17 26-03-2003 19:11
Autonomous Code From Experience EbonySeraphim Programming 7 14-03-2003 21:56
Autonomous code tutorial miketwalker Programming 2 23-02-2003 12:28
Autonomous code PBoss Programming 7 14-01-2003 15:29
Autonomous Code Adrian Wong Robotics Education and Curriculum 1 18-11-2002 22:34


All times are GMT -5. The time now is 13:06.

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