Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Autonomous weirdness in user_routines_fast.c (http://www.chiefdelphi.com/forums/showthread.php?t=27318)

Roland 29-03-2004 20:07

Autonomous weirdness in user_routines_fast.c
 
Until today we've been running all of our autonomous code in user_routines.c and only running it unless we have a certain combination of switces on a joystick port set. Yesterday, we made a competition port cable with the autonomous selection switch. We moved all of our auton code to the autonomous loop in u_r_f.c and tried to run our code, but it didn't send out the PWM values. It seems to be doing something, as a pneumatic valve actuates whenever we put it in autonomous mode, but nothing else seems to be doing anything. Any ideas?

Thanks,
Roland

Alan Anderson 29-03-2004 20:49

Re: Autonomous weirdness in user_routines_fast.c
 
Quote:

Originally Posted by Roland
...We moved all of our auton code to the autonomous loop in u_r_f.c and tried to run our code, but it didn't send out the PWM values...

The default User_Autonomous_Code function fails to call the routine to generate PWMs 13-16. If those are the ones you're using, add Generate_Pwms(pwm13,pwm14,pwm15,pwm16); right before Putdata(&txdata); and it should start working.

Roland 29-03-2004 21:07

Re: Autonomous weirdness in user_routines_fast.c
 
Nope, we weren't using those PWMs. We found a lot of problems like = instead of ==, though, so we seem to be getting closer to finding a solution. Our programming mentor is here now, so we're in good hands.

KenWittlief 29-03-2004 21:38

Re: Autonomous weirdness in user_routines_fast.c
 
when you moved it to the other file, did you bring all the variable declarations with you?

10intheCrunch 30-03-2004 00:26

Re: Autonomous weirdness in user_routines_fast.c
 
You'd get compiletime errors if you were missing declarations...sounds like you aren't calling Putdata(), but that would show up as a Code Error I believe. Have any error lights, or error from compiletime?

Roland 30-03-2004 00:48

Re: Autonomous weirdness in user_routines_fast.c
 
OK, we fixed it. It seems we were trying to access some switches on the OI during autonomous mode, and that's what screwed us up. Thanks for all your help!

KenWittlief 30-03-2004 11:36

Re: Autonomous weirdness in user_routines_fast.c
 
Quote:

Originally Posted by 10intheCrunch
You'd get compiletime errors if you were missing declarations...sounds like you aren't calling Putdata(), but that would show up as a Code Error I believe. Have any error lights, or error from compiletime?

not necessarily - if you have variables in the other file with the same names it will compile, but if you had meant to be using the same variables your program would not run correctly.


All times are GMT -5. The time now is 02:53.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi