Go to Post The 2016 Palmetto regional will be the most watched regional during week 0.5. - Procolsaurus [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Spotlight this post!  
Unread 15-02-2006, 18:16
ida_noeman's Avatar
ida_noeman ida_noeman is offline
Registered User
AKA: phobbs
FRC #1719 (Umbrella Corp.)
Team Role: Mechanical
 
Join Date: Jan 2006
Rookie Year: 2006
Location: Baltimore, MD
Posts: 129
ida_noeman is on a distinguished road
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)
This would work with something like this:
Code:
if (IN_DEAD_ZONE(p1_y))
p1_y = STOP;
__________________
--
"Weeks of coding can save you hours of planning"
"If the code was hard to write, I'm dam well going to make it hard to read!"

Last edited by ida_noeman : 15-02-2006 at 18:23.
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

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


All times are GMT -5. The time now is 02:10.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi