View Single Post
  #5   Spotlight this post!  
Unread 23-01-2012, 15:44
mikets's Avatar
mikets mikets is offline
Software Engineer
FRC #0492 (Titan Robotics)
Team Role: Mentor
 
Join Date: Jan 2010
Rookie Year: 2008
Location: Bellevue, WA
Posts: 667
mikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of light
Re: Help Needed with some Simple Programming

Regarding deadband, we use the following set of macros:
Code:
#ifndef DEADBAND_INPUT_THRESHOLD
  #define DEADBAND_INPUT_THRESHOLD  0.10
#endif
#define DEADBAND(n,t)           ((ABS(n) > (t))? (n): 0)
#define DEADBAND_INPUT(n)       DEADBAND(n, DEADBAND_INPUT_THRESHOLD)

 
float x = DEADBAND_INPUT(joystick.GetX());
float y = DEADBAND_INPUT(-joystick.GetY());
__________________
Reply With Quote