![]() |
GTS code Problems
I've been working on and revising the geartooth sensor autonoumous code for a few days now but no matter how I change it the code won't work. If anyone just has a quick example of working gear tooth sensor code it would be very helpful.The code that i'm using right now with Kevin's FRC code is right here...
Code:
void User_Autonomous_Code(void)Cnt_L, and Cnt_R as Long's. and i as an int. Thank You in advance |
Re: GTS code Problems
Quote:
|
Re: GTS code Problems
pretty much right now I'm trying to use a sample code to let the robot run for a certain number of gear counts(the exact number doesn't matter right now) and then after that time change the direction for another number of gear counts and then stop the robot. This should work as far as I can tell with the way I have the code but I can't right now when running the code the robot does NOTHING at all. This is very confusing so any help at all would be appreciated. If i can not make the gts work I'll be forced to use dead reconing...ughhh.
|
Re: GTS code Problems
I think the main reason it is doing NOTHING is that you have a misplaced closing brace. As your code stands now, your putdata() call is inside the "if (i>=6)" braces. You will need to add a "}" before /* Add your own autonomous code here. */, and get rid of one at the end of the routine.
I haven't digested the whole thing yet, but that might get you started. |
Re: GTS code Problems
Thank you very much. I'll try that tommorow when I get time to test on the robot.
|
Re: GTS code Problems
Still no movement or response. Thanks though.
|
Re: GTS code Problems
Quote:
first you set pwm02 to 170, then to 85, then to 170 again... maybe clean that up? |
Re: GTS code Problems
Quote:
Code:
float Total_Count, Total_Count_R, Total_Count_L;You set "i" to 0 on every call to User_Autonomous_Code, so "i" is guaranteed to always be less than 5. (If it were not for the fact that your putdata() call was within the (i>=6) block, you still should have seen SOME movement, since you set your PWMs outside of the if statements.) I guess you probably want something like: Code:
void User_Autonomous_Code(void) |
Re: GTS code Problems
In order to get into autonomus mode you need to jumper two pins on the OI's competition port. Which pins are specified in the manual.
|
| All times are GMT -5. The time now is 03:46. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi