Go to Post I think a lifetime of learning properly and then teaching others and inspiring the youth is more important to myself at least than being on the news for a couple seconds during a voice over. - Elgin Clock [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
  #1   Spotlight this post!  
Unread 25-03-2008, 14:29
kiettyyyy's Avatar
kiettyyyy kiettyyyy is offline
Registered User
FRC #1538 (The Holy Cows)
Team Role: Engineer
 
Join Date: Mar 2006
Rookie Year: 2005
Location: San Diego, CA
Posts: 181
kiettyyyy has a reputation beyond reputekiettyyyy has a reputation beyond reputekiettyyyy has a reputation beyond reputekiettyyyy has a reputation beyond reputekiettyyyy has a reputation beyond reputekiettyyyy has a reputation beyond reputekiettyyyy has a reputation beyond reputekiettyyyy has a reputation beyond reputekiettyyyy has a reputation beyond reputekiettyyyy has a reputation beyond reputekiettyyyy has a reputation beyond repute
Send a message via AIM to kiettyyyy
Angry Too many (If, Else If) statements?

Hey all!

I've been trying to make a better autonomous before our next regional. Since it's a day away, i've started to panic even more!

I've been using Kevin Watson's IR code, with a few additions to take commands and store them into the EEPROM. Once the commands are stored in the EEPROM, I have about 10 If/Else If statements to give our autonomous routine its desired waypoints.

Once I loaded my code via IFI Loader, the program light was STILL blinking! My code never entered the user teleoperated routine.

Later, I tried removing a few of the If/Else If statements, and I was left to TWO If/Else If statements. I compiled and loaded the code, the robot entered the user teleoperated routine with no problem.

Could I be edging on the side of overloading our IFI RC? Is there a way to get around this issue?

Thank you in advance!
  #2   Spotlight this post!  
Unread 25-03-2008, 14:46
Kevin Sevcik's Avatar
Kevin Sevcik Kevin Sevcik is offline
(Insert witty comment here)
FRC #0057 (The Leopards)
Team Role: Mentor
 
Join Date: Jun 2001
Rookie Year: 1998
Location: Houston, Texas
Posts: 3,745
Kevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond repute
Send a message via AIM to Kevin Sevcik Send a message via Yahoo to Kevin Sevcik
Re: Too many (If, Else If) statements?

This somewhat depends on where you put the if-else statements and if you had them all properly scoped. If you're putting these in an interrupt service routine, then it might just be taking up too much time and you'd get a red light of death. If you're doing this elsewhere then timing shouldn't be an issue. You might instead have some misplaced braces that are causing you to skip past the PutData() command or something. C18 doesn't seem to do anything too stupid when compiling nested if-elses, so I'm unsure what else this might be unless your code is so long that it needs to be using the large code model and you're not using it at the moment. Perhaps if you just tried re-compiling your original code. I can't think of anything other than a corrupted file that would keep the controller in a program state after a download.
__________________
The difficult we do today; the impossible we do tomorrow. Miracles by appointment only.

Lone Star Regional Troubleshooter
  #3   Spotlight this post!  
Unread 25-03-2008, 14:47
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
Re: Too many (If, Else If) statements?

Is it using the large code model (see here: http://www.ifirobotics.com/docs/memory_problem_8722.pdf)?

Last edited by Joe Ross : 25-03-2008 at 15:03. Reason: fix grammar
  #4   Spotlight this post!  
Unread 25-03-2008, 15:04
kiettyyyy's Avatar
kiettyyyy kiettyyyy is offline
Registered User
FRC #1538 (The Holy Cows)
Team Role: Engineer
 
Join Date: Mar 2006
Rookie Year: 2005
Location: San Diego, CA
Posts: 181
kiettyyyy has a reputation beyond reputekiettyyyy has a reputation beyond reputekiettyyyy has a reputation beyond reputekiettyyyy has a reputation beyond reputekiettyyyy has a reputation beyond reputekiettyyyy has a reputation beyond reputekiettyyyy has a reputation beyond reputekiettyyyy has a reputation beyond reputekiettyyyy has a reputation beyond reputekiettyyyy has a reputation beyond reputekiettyyyy has a reputation beyond repute
Send a message via AIM to kiettyyyy
Re: Too many (If, Else If) statements?

Quote:
Originally Posted by Joe Ross View Post
Is it using the large code model (see here: http://www.ifirobotics.com/docs/memory_problem_8722.pdf)?
I went ahead and looked at my project files, the compiler was set to work with the small code model that was less than 64k bytes. I hope this works!! I'll be heading over to the field very shortly to find out.

Thank you!
  #5   Spotlight this post!  
Unread 25-03-2008, 17:38
kiettyyyy's Avatar
kiettyyyy kiettyyyy is offline
Registered User
FRC #1538 (The Holy Cows)
Team Role: Engineer
 
Join Date: Mar 2006
Rookie Year: 2005
Location: San Diego, CA
Posts: 181
kiettyyyy has a reputation beyond reputekiettyyyy has a reputation beyond reputekiettyyyy has a reputation beyond reputekiettyyyy has a reputation beyond reputekiettyyyy has a reputation beyond reputekiettyyyy has a reputation beyond reputekiettyyyy has a reputation beyond reputekiettyyyy has a reputation beyond reputekiettyyyy has a reputation beyond reputekiettyyyy has a reputation beyond reputekiettyyyy has a reputation beyond repute
Send a message via AIM to kiettyyyy
Re: Too many (If, Else If) statements?

Thanks all!!! The code works great!!!
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
Too many interrupts? windell747 Programming 4 06-02-2008 23:55
pic: TOO MANY TETRAS!!!! Ali Ahmed Extra Discussion 12 22-01-2005 10:06
Else Statements!!! Adam Shapiro Programming 9 22-12-2002 01:27


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

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