View Single Post
  #6   Spotlight this post!  
Unread 12-01-2011, 19:01
jhersh jhersh is offline
National Instruments
AKA: Joe Hershberger
FRC #2468 (Appreciate)
Team Role: Mentor
 
Join Date: May 2008
Rookie Year: 1997
Location: Austin, TX
Posts: 1,006
jhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond repute
Re: How do I use interrupt in Java?

Quote:
Originally Posted by danielcezar View Post
I'm trying to call a interrupt each 25ms, because i want to write my own PID control, and with this interrupt i'm acumulate the error to calc the integral.
Have you tried the built-in PID classes?

Quote:
Originally Posted by danielcezar View Post
someone here said me to use a thread, and i did it, a diferent class with with the thread, overwriting the run method. But when i try to call .sleep to wait each 25ms, it stops the intire robot.
I think we would need to see the code you use to start the thread to know if you are actually running in a separate thread. Also, if you are calling out into C land, you will block the whole Java VM until you return (unless you are using the "BlockingFunction" class).
Reply With Quote