Go to Post Anything that promotes science and technology is okay in my book. - Dan Richardson [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

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #16   Spotlight this post!  
Unread 24-09-2003, 19:37
Unsung FIRST Hero
miketwalker miketwalker is offline
Robot Lifeguard
FRC #1902 (Exploding Bacon)
 
Join Date: Dec 2001
Rookie Year: 2002
Location: Orlando, FL
Posts: 878
miketwalker has a reputation beyond reputemiketwalker has a reputation beyond reputemiketwalker has a reputation beyond reputemiketwalker has a reputation beyond reputemiketwalker has a reputation beyond reputemiketwalker has a reputation beyond reputemiketwalker has a reputation beyond reputemiketwalker has a reputation beyond reputemiketwalker has a reputation beyond reputemiketwalker has a reputation beyond reputemiketwalker has a reputation beyond repute
Send a message via AIM to miketwalker
Quote:
Originally posted by golf_cart_john
Are you using the newer version of PBASIC or the older version? Innovation First came out with a newer version for the 2003 season, and it doesn't use that format for the IF statements. I don't know if that would tokenize properly, but might be your problem.
With the 2003, the code works the same as every other year, you could just use the new version if you wanted but the old IF loops work fine still.
__________________
Chopsaw? Chopsaw.
  #17   Spotlight this post!  
Unread 24-09-2003, 22:56
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,600
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
Quote:
Originally posted by gwross
My guess is that either[list=1][*]the 255s are causing the problem, or[*]some part of the code other than that of which we have visibility is preventing the serout from being executed.[/list=1]
Yes, you're right about the serin. I realized that after I looked at that same document for a different reason, today.

Quote:
Originally posted by gwross

BTW, the two relay bytes are deliberately interspersed in the serout command between PWMs 1, 2 and 3 to prevent 255s output to PWMs from causing problems in the most common cases where someone is using the default code (or has made minimal modifications to it.) So, Salik, if you're using two consecutive PWMs (not including 1 and 2) for drive_r and drive_l, there's your problem. (Actually, it is still possible to provoke this problem when you're using PWMs 1 through 3 if you happen to turn on all the relays in one of the relay bytes.)
This is why my initial inclination was that the 255's are not causing the problem. However, after going throught the code snippet, both won't be set to 255 until dist > 9. So, either dist would have to be initialized to > 9 or the sensor would be giving a larger value then was expected. It should definetly be fixed, but I don't think it is the cause of the problem.


salik: it appears that whlc is the number of feet that you have traveled. Is that correct? How is this value computed? Are you reading it directly from your infrared sensor, is it being calculated in your program based on sensor readings? is it calculated in your custom circuit?

One common cause of your program taking to long to execute a loop is too many debug statements. Are you using any anywhere else in your code?
  #18   Spotlight this post!  
Unread 25-09-2003, 20:14
josh_johnson josh_johnson is offline
Registered User
#1020 (Indiana Prankmonkeys)
 
Join Date: Nov 2002
Location: Muncie, IN
Posts: 58
josh_johnson is an unknown quantity at this point
Send a message via AIM to josh_johnson Send a message via Yahoo to josh_johnson
Quote:
BTW, the two relay bytes are deliberately interspersed in the serout command between PWMs 1, 2 and 3 to prevent 255s output to PWMs from causing problems in the most common cases where someone is using the default code (or has made minimal modifications to it.)
Actually, they are interspersed to prevent problems from occurring when both relay output bytes are 255. A change from 255 to 254 will make almost no difference with the analog PWM outputs, but changing this in a relay output would completely reverse one of the digital output pins, most likely causing very undesired operation. Also, if i remember correctly, the default code sets a maximum of 254 for all the PWM outputs it uses.

My guess is that somewhere else you are doing one of 5 things:

1. getting stuck in an infinite loop
2. taking too long on part of your code. This could be caused by a loop that is ran multiple times or from several debug statements
3. skipping over your serout statement
4. you are using the serout statement incorrectly.(i.e. outputting to the wrong pin, etc.)
5. not looping back to your serin command.

It is hard to say without seeing the rest of your code. If you could post all of the code, it would be very helpful in determining your problem.

[edit] added a 5th item [/edit]
__________________
5! * (4! - 3! - 1!) / 2!

Last edited by josh_johnson : 25-09-2003 at 20:22.
Closed Thread


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
A better autonomous method.. randomperson Programming 4 24-02-2004 18:02
autonomous mode problem on field Chris_C Programming 17 26-03-2003 19:11
Fried program slots? Jeff Waegelin Programming 18 19-03-2003 18:08
Autonomous Kill Switch UCGL_Guy Programming 8 15-01-2003 17:39
Ahh! Program trick confusing! archiver 2001 9 24-06-2002 02:26


All times are GMT -5. The time now is 01:27.

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