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.


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?

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.

what did you change?

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.

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.

So whats the difference between “\r” and "
" ?

the difference is three!
well that is if you subtract them in the code.
Each character has a different value.
" is equivilent to character 10. so if you were to do char a=10, it would be the same as char a=’

“\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
(line feed) means to go to the next line.