|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Code runs only once, fails on reset
Having a weird problem, after downloading our code into the FRC, it runs without problems (all green flickers). However, when the reset button is pressed, or the bot is powered off and on, the Program State flickers red, and the RC Mode is solid yellow. Nothing will work until I download the code again.
The condition is not present when using the default code. Any ideas where to look in my code for the problem? Its puzzling that it runs perfect until the controller is reset. Thanks. |
|
#2
|
|||
|
|||
|
Re: Code runs only once, fails on reset
Look at main.c, then follow each function in either user_routines.c or user_routines_fast.c also have you made the project and successfully built it before you uploaded it?
|
|
#3
|
|||||
|
|||||
|
Re: Code runs only once, fails on reset
You can try hooking up your PC to the dashboard port on the OI and running the IFI dashboard program. That will provide diagnostics in certain cases.
|
|
#4
|
||||
|
||||
|
Re: Code runs only once, fails on reset
what did you change?
|
|
#5
|
||||
|
||||
|
Re: Code runs only once, fails on reset
We had this problem up until the end of working today. It happened after I updated our master code to version 10. Not even the Frc_default.hex with it would work. Then I tried the 2.4 default code version and there was no longer a code error. So now we just have to recode in all of our changes that we have made in the past 5 weeks.
|
|
#6
|
||||
|
||||
|
Re: Code runs only once, fails on reset
The problem might lie in the printf statements... We had this problem last week or the week before (build season is just a big blur). You should only be using \r for your new lines.
|
|
#7
|
|||||
|
|||||
|
Re: Code runs only once, fails on reset
So whats the difference between "\r" and "\n" ?
|
|
#8
|
|||||
|
|||||
|
Re: Code runs only once, fails on reset
Quote:
well that is if you subtract them in the code. Each character has a different value. "\n" is equivilent to character 10. so if you were to do char a=10, it would be the same as char a='\n' "\r" is equivilent to character 13. so if you were to do char a=13, it would be the same as char a='\r' So the difference is 13 - 10, and you would get three. \r (carriage return) means to go the beginning of the line, and \n (line feed) means to go to the next line. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Out of the Box Camera Code | russell | Programming | 9 | 10-21-2009 05:28 AM |
| Code suddenly fails to initialize | miketwalker | Programming | 11 | 02-19-2005 03:23 PM |
| Team THRUST - Kevin's Code and Camera Code Combine | Chris_Elston | Programming | 3 | 01-31-2005 10:28 PM |
| Sourceforge for Code Repository and other stuff | SilverStar | Programming | 9 | 01-15-2005 09:16 PM |
| heres the code. y this not working | omega | Programming | 16 | 03-31-2004 03:18 PM |