![]() |
Where is tank drive in 2005 code?
I am still trying to understand the 2005 default code (my programming team is currently using the 2005 robot because they are currently working on the new one.) What I want to do right now is try to modify the tank drive so it is less sensitive. I can find where the 1-joystick drive is but I cannot find where the 2-joystick (tank drive) is. Is there a particular place that it is in in the code? thanks
|
Re: Where is tank drive in 2005 code?
EDIT: Just noticed your edit - They're located in user_routines.c in the default routine.
They should look something like this. pwm01 = p1_y; pwm02 = p2_y; pwm03 = p3_y; pwm04 = p4_y; etc.... |
Re: Where is tank drive in 2005 code?
Quote:
|
Re: Where is tank drive in 2005 code?
also, if you want to limit response to the joystick, you can multiply the joystick value by a decimal value less than 1. For example, one of the robot components in our robot requires small movements, but we found it complicated to just move it slightly, so we multiplied the joystick input by .20, so even when the joystick is fully deflected it will move slowly.
-Unholy |
Re: Where is tank drive in 2005 code?
Be careful, it's very easy to accidentally make it multiply by 0, the PIC has no dedicated floating point processor and does weird things to decimals. It would make your motors constantly run full reverse. Which is also bad :)
I recommend multiplying up then dividing down. For example instead of Code:
pwm01 = p1_y * 0.2; //Error Prone! BAD!Code:
pwm01 = (unsigned int)(p1_y * 2) / 10;Good luck! |
Re: Where is tank drive in 2005 code?
Quote:
|
Re: Where is tank drive in 2005 code?
Quote:
|
Re: Where is tank drive in 2005 code?
Quote:
You can try something like this: Code:
if(p1_y>117 && p1_y<137) //+-10 unit deadband around 127 neutralHope this helps, |
| All times are GMT -5. The time now is 01:36. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi