Search the forum for TimerTask. On Mar 12, 2016 6:16 AM, "Kevin Miller" <[email protected]> wrote:
> Ytai, > Can you provide some detail on how to use a TimerTask and interrupt the > thread? I read Javadoc for Pulseinput.getDurationBuffered() and it says: > > Reads a single measurement from the queue. If the queue is empty, will > block until more data arrives. The calling thread may be interrupted in > order to abort the call. See interface documentation for further > explanation regarding the read queue. > > > But I could not find the "interface documentation" that explains the read > queue. > > Thanks, > Kevin > > On Sunday, March 6, 2016 at 11:54:24 PM UTC-5, Kevin Miller wrote: >> >> Hello, >> I'm using an HC-SR04 in a IOIOService loop. I used a Timer to set a flag >> periodically so that the Looper will know when it should perform a ranging. >> >> If I use getDurationSync() the Looper will hang on getDurationSync after >> about 10 readings with the timer set to 500 (ms?) delay between triggers. >> >> Second, if the sensor is unplugged, it hangs at getDuration() in every >> case no matter what form of getDuration I use or what the timer delay is. >> Is this by design to hang if there is no pulse, or is it possible to >> timeout? >> >> Thanks, >> Kevin >> > -- > You received this message because you are subscribed to the Google Groups > "ioio-users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at https://groups.google.com/group/ioio-users. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "ioio-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/ioio-users. For more options, visit https://groups.google.com/d/optout.
