|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
||||
|
||||
|
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
|
|||||
|
|||||
|
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.
|
|
#3
|
||||||
|
||||||
|
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
|
||||
|
||||
|
Re: Too many (If, Else If) statements?
Quote:
Thank you! |
|
#5
|
||||
|
||||
|
Re: Too many (If, Else If) statements?
Thanks all!!! The code works great!!!
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
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 |