|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
Desensitizing Joysticks
We are trying to desensitize our joysticks and we know what to add to the code but we don't know where to add it. Whether to add it to User Routines Fast or User Routines. Where do we add it.
|
|
#2
|
|||||
|
|||||
|
Re: Desensitizing Joysticks
Whenever you want to do processing on operator input (filtering, desensitizing, delta-coding, etc.), it makes the most sense to do it only when new values are available. I would definitely put it in user_routines.c, in the Process_Data_From_Master_uP() function.
|
|
#3
|
|||
|
|||
|
Re: Desensitizing Joysticks
Quote:
Code:
unsigned char Dead_Band(unsigned char input_value)
{
unsigned char Output = 127;
if (input_value < Dead_Band_Forward)
{
if(input_value > Dead_Band_Reverse)
{
Output = 127;
}
else
{
Output = input_value;
}
}
else if(input_value > Dead_Band_Forward)
{
Output = input_value;
}
return Output;
}
Code:
void Default_Routine(void).......... pwm01 = Dead_Band(p1_y); pwm02 = Dead_Band(p2_y); |
|
#4
|
||||
|
||||
|
Re: Desensitizing Joysticks
I know you said you already solved the coding part, but this thread extensively covers this topic.
Edit: If you want to take a look at the low pass filter I mention, PM me. The version in the papers contains a slight bug. (Well, ok, it's fatal... but only if you push the joystick all the way forward. )Last edited by Ryan M. : 12-10-2004 at 17:46. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| need joysticks! | Tom Bottiglieri | General Forum | 14 | 24-02-2004 09:36 |
| AVB joysticks..and other analogue joysticks | tml240 | Kit & Additional Hardware | 6 | 07-02-2004 12:45 |
| Other joysticks | tml240 | Programming | 8 | 05-02-2004 15:09 |
| number of joysticks | doy | Rules/Strategy | 5 | 01-02-2004 00:05 |
| Calibrating speed controllers and joysticks | thedillybar | Technical Discussion | 4 | 11-02-2002 13:24 |