![]() |
Need Help with Sensitivity of Joysticks
I'm trying to decrease the maximum range of the joystick on the x-axis using EasyC because the robot turns too fast on the x-axis. I tried using arcade mode at first, but I don't see a way of limiting the joystick range or the PWM output via the Arcade function.
What I tried to do was limit the PWM input. As a test, instead of being 0 (Minimum output), it is now 77, and it is 177 as a maximum. I used the following code and it doesn't seem to work. Does anyone know how I can do this? Code:
unsigned char Port1XAxis = 127; Thanks a lot. |
Re: Need Help with Sensitivity of Joysticks
We used this to scale our drive last year. The "Offset" is referring to how far the joystick's Y-axis potentiometer is from 127.
Code:
int Scale_Offset(int initialValue, double scaleFactor) {pwm05 = Scale_Offset(p1_y,3.); |
Re: Need Help with Sensitivity of Joysticks
That's right and I actually tried to do a function like that, but I am using EasyC's 'Arcade 2-motor' function to be able to control all motors through one joystick and it doesn't seem to allow for any input like that.
In Arcade mode, Y-Axis movement indicates forward/reverse, and X-Axis indicates right/left, and what I want to do is limit the X-Axis max PWM to something to slow it down (maybe minimum value of 77 and max of 177). Does anyone know if/how I can do this in EasyC? |
Re: Need Help with Sensitivity of Joysticks
My team has been using a speacial sin curve array to tone down the sensitivity. It has kind of been a hand-me-down for four years now.
Code:
const rom unsigned char joystick_values[256] = { Code:
pwm_01 = joystick_values[p1_y];As for limiting speed, I have no idea what the arguments of the Arcade function are. If set pwms are what you are using to change the pwm values, they are commented out (you probably know that already). You also have it set 177 on the 77 if statement and 77 on the 177 if statement. Would switching those two help? |
Re: Need Help with Sensitivity of Joysticks
As far as joystick sensitivity goes, our team has been using this:
Code:
long ramping (unsigned char ramp)http://www.chiefdelphi.com/forums/at...9&d=1201127844 |
Re: Need Help with Sensitivity of Joysticks
Quote:
|
| All times are GMT -5. The time now is 23:44. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi