Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Code runs only once, fails on reset (http://www.chiefdelphi.com/forums/showthread.php?t=35044)

roknjohn 20-02-2005 12:43

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.

SpeakerSilenced 20-02-2005 12:48

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?

Mark McLeod 20-02-2005 14:05

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.

whakojacko 20-02-2005 14:08

Re: Code runs only once, fails on reset
 
what did you change?

bbene 20-02-2005 19:03

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.

Ryan Cumings 20-02-2005 22:45

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.

Fat Alex 21-02-2005 14:06

Re: Code runs only once, fails on reset
 
So whats the difference between "\r" and "\n" ?

AIBob 21-02-2005 20:24

Re: Code runs only once, fails on reset
 
Quote:

Originally Posted by Fat Alex
So whats the difference between "\r" and "\n" ?

the difference is three!
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