View Single Post
  #5   Spotlight this post!  
Unread 06-08-2012, 18:18
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,561
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
Re: How do I program a joystick deadband?

Quote:
Originally Posted by F22Rapture View Post
Does this appear to be correct?

You've created a new function, but haven't called it. In order to do the equivalent of the commented out code, you would need to add another line similar to the following
Code:
double turn = turn(Xbox);
(I'm not very experienced with java, so it might not even compile with having variable named the same as a function). Notice how this isn't exactly clear, which is why Djur recommended renaming turn to something more generic. Doesn't this sound better?
Code:
double turn = applyDeadband(Xbox);
There's probably a better way to write the deadband function so that you could apply it to the throttle also easily without creating a second function. Can you think of another way to do it?
Reply With Quote