![]() |
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.
|
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. |
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.
|
Re: Dead zone for RC control
A very readable way to do it is to make an inline function like this:
Code:
#define STOP 127Code:
if (IN_DEAD_ZONE(p1_y)) |
| All times are GMT -5. The time now is 01:33. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi