![]() |
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. |
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?
|
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.
|
Re: Code runs only once, fails on reset
what did you change?
|
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.
|
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.
|
Re: Code runs only once, fails on reset
So whats the difference between "\r" and "\n" ?
|
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. |
| All times are GMT -5. The time now is 10:56. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi