View Single Post
  #3   Spotlight this post!  
Unread 18-02-2011, 11:36
derekwhite's Avatar
derekwhite derekwhite is offline
Java Virtual Machine Hacker
no team (FIRST@Oracle)
Team Role: Programmer
 
Join Date: May 2009
Rookie Year: 2009
Location: Burlington, MA
Posts: 127
derekwhite is on a distinguished road
Re: type tInterruptHandler doesn't seem to exist

The "callback" version of requestInterrupts() was not fully implemented, but you should be able to use the synchronous version of requestInterrupts().

You can then have your interrupt handling code in a loop that first calls waitForInterrupt(). Roughly:

digIn.requestInterrupts();
while (true) { // or some condition
digIn.waitForInterrupt(300.0);

// ...do your interrupt handling code...

}
digIn.cancelInterrupts();

That loop can be pushed off to another Java thread.
Reply With Quote