|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
Dead zone for RC control
I'm using the arcade drive controls through Easy C, but the current controller the drivers want to use doesn't center itself very well, so I need to know if there is anyway to put a dead zone into the code. Thanks for the help.
|
|
#2
|
||||
|
||||
|
Re: Dead zone for RC control
Quote:
I think you have two choices: 1. See this Post and use the drive ( ); function. "built in deadband". 2. Make your own "arcade" control by mixing the port1_x and port1_y with a SETPWM. Then using IF statements so that the mixed values from the joystick have to be greater than your deadband, else SetPWM 127. |
|
#3
|
|||
|
|||
|
Re: Dead zone for RC control
I figured out a really easy way to do it. Turns out I just didn't think it through. I made a simple If-Else statement. If the joystick values are between then set pwms as 127 else tank drive. Worked well enough.
|
|
#4
|
||||
|
||||
|
Re: Dead zone for RC control
A very readable way to do it is to make an inline function like this:
Code:
#define STOP 127 #define DEAD_ZONE 15 // or any other number, fool around with this to make it work as you want it to #define IN_DEAD_ZONE(x) (x <= DEAD_ZONE + STOP && x>= STOP - DEAD_ZONE) Code:
if (IN_DEAD_ZONE(p1_y)) p1_y = STOP; Last edited by ida_noeman : 15-02-2006 at 18:23. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Concept of PID explained | ConKbot of Doom | Technical Discussion | 11 | 27-01-2008 00:11 |
| Member of multiple (FRC, FLL, VEX) teams in profile/user control panel? | Elgin Clock | CD Forum Support | 3 | 03-12-2005 20:41 |
| YMTC - Flopper? in the ZONE? | Jack Jones | You Make The Call | 6 | 04-04-2005 12:59 |
| **FIRST EMAIL**/2005 FRC Game Design Communication to FRC Teams | Goobergunch | FIRST E-Mail Blast Archive | 1 | 06-01-2005 09:29 |