View Full Version : 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
...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.
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
when you moved it to the other file, did you bring all the variable declarations with you?
10intheCrunch
30-03-2004, 00:26
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?
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
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.
vBulletin® v3.6.4, Copyright ©2000-2017, Jelsoft Enterprises Ltd.